w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Nginx 'rewrite or internal redirection cycle while internally redirecting' resulting in 500
Have you tried something like this? (specific to Magento maybe) server { listen 80 default; ssl off; root /var/www/magento; server_name mydomain.com.au; location / { index index.html index.php; try_files $uri $uri/ @handler; expires 30d; } location ^~ /app/ { deny all; } location ^~ /includes/ { deny all; } location ^~ /lib/ { deny all; } location ^~ /media/downloadable/ { deny all; } location ^~ /pkginfo/ { deny all; } location ^~ /report/config.xml { deny all; } location ^~ /var/ { deny all; } location /var/export/ { ## Allow admins only to view export folder auth_basic "Restricted"; ## Message shown in login window a

Categories : Wordpress

How to add redirection rule and rewrite rule in Azure for xcart application hosted in azure
You need to look at IIS url rewrite module for redirection and rewrite. See here. This tool basically writes the rules to web.config file. Update:What you can do is, on a machine with IIS installed, install this module. Then run this tool locally and create rules using this tool. This tool will write the changes to web.config file of the app on which you try to run this tool. See this example Google and you may find some migration tool.

Categories : Azure

htaccess rewrite rule not passing url vars when script file is same as rewrite directory
This sounds suspiciously like a Multiviews related problem coupled with some PATH_INFO. The Multiviews option is part of mod_negotiation and it will try to match a requested URL path to a file path. It sees: /portfolio/2/ And sees that there's a /portfolio.php file in the filesystem and assumes that this is what you want (which it is, but not in the same way). I'm willing to bet that instead of looking at $_GET['id'], which is blank of course since there are no GET params, if you look at $_SERVER['PATH_INFO'], you'll see it set to /2/. This is equivalent to going to: /portfolio.php/2/ where the /2/ part gets passed to portfolio.php as part of the PATH_INFO. And since mod_negotiation is further up in the processing pipeline than mod_rewrite, your rewrite rules never get applied. Try

Categories : PHP

Rewrite Rule not working for Ionics Isapi Rewrite filter
The expression is regex - you have to escape the ? character - i.e. RewriteRule ^(?i)/index.aspx[?]puid=2369474A-950C-4A24-A73E-8EF5F149CB95 /Error.aspx [G,I] Also changing [G] to [G,I] for enforcing "ignore case sensitivity".

Categories : Regex

nGinx rewrite if previous rewrite did not find any file
I know you seem to have figured it out, but i would like to suggest a simpler answer, might need some fixing but you'll get the idea, Note: I haven't tested those. location ~ /(?:images|stylsheets|scripts) rewrite ^(.*)$ /assets/$1; } or maybe location ~ /(?:images|stylesheets|scripts) rewrite ^ /assets$request_uri; }

Categories : Nginx

Redirection PHP
In PHP: $mail = mail($email_to, $email_subject, $email_message, $headers); if( $mail ){ // success message $msg = "Success - Send Successfully"; echo "<script>top.location.href = 'index.html#$msg';</script>"; } else { // Error message $msg = "Error - Email not Send"; echo "<script>top.location.href = 'index.html#$msg';</script>"; } Use some javascript to get the result from the url into your index.html file, in above sample i send the message with hash, now determine the hash from the url with javascript. if(window.location.hash) { // Fragment exists //Puts hash in variable, and removes the # character var hash = window.location.hash.substring(1); // Determine the success or failure var patt=/Success/g; var result=patt.test(hash); if( r

Categories : PHP

Else if, URL redirection
Please have a look at W3Schools site. If...else if...else Statement if (condition1) { code to be executed if condition1 is true } else if (condition2) { code to be executed if condition2 is true } else { code to be executed if neither condition1 nor condition2 is true } You can chain many else if blocks if you need to.. Consider using the Switch statement as well.

Categories : Javascript

URL redirection JSF
You can simply add the context path to the links by rendering it in front of your links. Something like: <a href="#{request.contextPath}/#{someBean.linkFromDatabase}">write</a>

Categories : JSF

Efficent url redirection in php
Yes, what you should do is keep the real link in the href attribute (so the "Copy link location" works), and with a bit of Javascript, on the click event of your link, replace this real URL with your redirecting one's.

Categories : PHP

php redirection using header
use this one in script window.parent.location='http://localhost/users/login.php' or follow this link https://forums.digitalpoint.com/threads/button-to-navigate-to-a-new-page-but-exit-the-iframe-too.1846291/ hope you will get solution.

Categories : PHP

C++ file-redirection
To use your code [1] you have to call your program like this: App.exe < inputfile > outputfile You can also use: App.exe < inputfile >> outputfile In this case the output wouldn't be rewrited with every run of the command, but output will be appended to already existing file. More information about redirecting input and output in Windows you can find here. Note that the <, > and >> symbols are to be entered verbatim — they are not just for presentation purposes in this explanation. So, for example: App.exe < file1 >> file2

Categories : C++

.htaccess and .php? redirection
just add ? at the end of rewriteRule to override query string RewriteCond %{QUERY_STRING} ^id=1$ RewriteRule ^oldpage.php$ http://www.newwebsite.com/newpage2.html? [R=301,L]

Categories : PHP

Redirection in bash
The way you're doing it is correct. You can't redirect both stdin and stderr to the same file. You can redirect stdout and stderr to the same file, though: command >file.txt 2>&1

Categories : Bash

how to specify redirection ZF2 constructor?
You are better off doing this in the onDispatch event, either by attaching to the event, or putting the code into the onDispatch method. You won't have acess to any ServiceLocator / ServiceManager in the contructor as they are injected after the class is instantiated. SomeBaseController.php /** * Override, check for login etc * * @param endMvcMvcEvent $e */ public function onDispatch(endMvcMvcEvent $e) { if( ! /** SOME CONDITION **/) { return $this->redirect()->toRoute('login'); } return parent::onDispatch($e); }

Categories : PHP

URL redirection in .htaccess
there is a few ways you could do it. First and probably the easiest is to create a DNS C-Name Reccord, but seeing as you tagged apache and .htaccess i'm going to guess you want to use mod_rewrite <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} example.com RewriteRule (.*) http://example.net/$1 [L] </ifModule> you can eliminate the RewriteCond if you want everything that hits the web server folder to redirect, but this way it prevents redirect loops by only redirecting http://example.com

Categories : Apache

How to keep clean url after redirection
You can't "keep the clean url" for a url that exists on a different server. One of the only ways to have a "clean url" is to use an iframe like this: /cap.html <iframe frameBorder="0" src="https://docs.google.com/a/l5lab.com/forms/d/1gTVPzkBSyKAiLNv26MhVlfGfYf78AgNY0OWA0PQm3lY/viewform" style="width: 100%; height: 2210px;"></iframe>

Categories : PHP

Nonstandard io redirection
I guess it isn't really fair for the people working on answers right now, but I think I got it: if [ ! -e /tmp/deployed.err ] then mkfifo /tmp/deployed.err fi tee -a testlog </tmp/deployed.err & ./testscript 2>/tmp/deployed.err 1>>testlog It appears to work, but I'm worried that the messages in the log will get out of order. Anyone have a better idea?

Categories : Bash

Submit without redirection
Here is what I use to make an ajax call: var sendData = "action=do_action"; sendData += "&value=" + $("input.value").val(); $.ajax({ url: "post.php",//Page to send our data to global: false, type: "POST", data: sendData, dataType: "html", async:false, success: function(data){ //We could return JSON and then just parse that, but I usually just return values like this //create jquery object from the response html var $response=$(data); var results = $response.filter('div.results').text();//Or .html() if we want to return HTML to show if (results == "true") { alert("it works"); }else{ var reason= $response.filter('div.reason').text(); alert(reason);

Categories : Javascript

Orchard CMS 301 redirection
Cant you just use the Rewrite Rules module on the gallery? http://gallery.orchardproject.net/List/Modules/Orchard.Module.Contrib.RewriteRules

Categories : Asp Net Mvc

System.out redirection to JTextPane
You're shadowing the variable textPane in the constructor of Console. Replace JTextPane textPane = new JTextPane(); with textPane = new JTextPane();

Categories : Java

Mobile detection and redirection. How do i?
There is lots of help on this, It is done by checking user agent property, String userAgent = request.getHeader("User-Agent"); you can visit, Detecting Device Type in a web application

Categories : Javascript

Spring MVC Rest URL and URL redirection
As far as know, I don't think so. But one way will be like, each time your controller will produce JSON response. But for web application you need to add extra call for each request which will load desired page and then call your CRUD methods on load of your page and parse the JSON response to fill the data.

Categories : Java

Shell redirection i/o order
This error: ls: *.xyz: No such file or directory is being written on stderr by ls binary. However in this command: ls -al *.xyz 2>&1 1> files.lst You're first redirecting stderr to stdout which by default goes to tty (terminal) And then you're redirecting stdout to a file files.lst, however remember that stderr doesn't redirected to file since you have stderr to stdout redirection before stdout to file redirection. Your stderr still gets written to tty in this case. However in 2nd case you change the order of redirections (first stdout to file and then stderr to stdout) and that rightly redirects stderr to a file which is also being used by stdout.

Categories : Bash

Cyclic redirection in .htaccess
There's a module called mod_dir that's automatically loaded and it causes requests for directories that are missing the trailing slash to get redirected with a trailing slash. You can turn this off using the DirectorySlash directive, but note the security warning when you turn it off. There's an information disclosure security issue if you turn it off and default indexes won't get loaded. However, your lats rule (looks like) it does that, though incorrectly. First, turn off the DirectorySlash DirectorySlash Off Then you need to change the last rule to: RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME}/index.php -f RewriteRule ^(.*)$ /$1/index.php [L]

Categories : Htaccess

How can I strip some numbers on a url for 301 redirection
I found a solution for this, I used: RedirectMatch 301 ^/the-news/(.*)/d{1,6}-(.*)$ http://www.example.com/$2 The d{1,6} part is for recognizing numbers from 1 to 6 digits.

Categories : Htaccess

CAS redirection with wrong path
I finaly found the solution. I replaced this lines : <init-param> <param-name>serverName</param-name> <param-value>http://localhost:8080/firstCasClient</param-value> </init-param> by : <init-param> <param-name>service</param-name> <param-value>http://localhost:8080/firstCasClient</param-value> </init-param> in CAS Authentication Filter and CAS Validation Filter Then it works fine :)

Categories : Java

Javascript Geo Redirection not working
You script is missing some termination code. Place this }); right before the </SCRIPT>. So your code should look like this... <script src="http://code.jquery.com/jquery-latest.js"></script> <SCRIPT LANGUAGE='JavaScript'> $.getJSON( "http://smart-ip.net/geoip-json?callback=?", function(data){ if (data.countryCode == "CA") { window.location = 'canada.php'; } else { window.location = 'usa.php'; } }); </SCRIPT>

Categories : Javascript

Multi-way redirection of System.out
Were you thinking that the Troll.Interceptor.print() would automatically call the print() method in Console.Interceptor? That doesn't happen. When Troll.Interceptor.print() calls super.print(s), it calls the print() method defined for PrintStream. You've constructed the PrintStream with an OutputStream, and OutputStream doesn't have a print() method. The PrintStream logic will perhaps call write() on the underlying OutputStream (and write() has not been overridden), but there's no way for it to call print(), since PrintStream.print() doesn't see "out" as another PrintStream. I don't know how much this helps you, since I'm not really clear on what you were expecting it to do.

Categories : Java

Error redirection not working
I believe what you're looking for is: MyScript > c:output.txt 2>&1 The "> c:output.txt" redirects STDOUT to a file The 2>&1 redirects STDERR to STDOUT When you've already done the STDOUT redirection, the result is redirection of both STDOUT and STDERR to c:output.txt With only "2>&1 c:output.txt" you're redirecting stderr to stdout, but letting stdout still output to console, and merely supplying c:output.txt as an unused parameter to your script.

Categories : Powershell

HTML5 video redirection
Since it looks like you're using Video.JS for this, you should have a look at their docs: https://github.com/videojs/video.js/blob/master/docs/index.md Specifically, the API section: https://github.com/videojs/video.js/blob/master/docs/api.md In the "Events" section, it says: ended Fired when the end of the media resource is reached. currentTime == duration So you'd need to get a reference to your player (also on that page): var myPlayer = videojs("example_video_1"); and then listen for the ended event, and redirect from there: function endedFunction(){ window.location = 'http://www.example.com/'; } myPlayer.on("eventName", endedFunction);

Categories : Javascript

Redirection rule issue
You can use flags R and QSA for this like, /externalAAA?(.*) /abc/bcde/aa.php?$1 [R,QSA] Also write the above line before writing and other rule in your htaccess

Categories : Regex

Special 301 redirection rules
This is code needed on DOCUMENT_ROOT/.htaccess on new.com: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(www.)?new.com$ [NC] RewriteRule ^$ http://new.com/main [R=301,L] This is code needed on DOCUMENT_ROOT/.htaccess on old.com: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(www.)?old.com$ [NC] RewriteRule ^$ http://new.com/main [R=301,L] RewriteCond %{HTTP_HOST} ^(www.)?old.com$ [NC] RewriteRule ^(.+)$ http://new.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^([^.]+).old.com$ [NC] RewriteRule ^$ http://%1.new.com/main [R=301,L] RewriteCond %{HTTP_HOST} ^([^.]+).old.com$ [NC] RewriteRule ^(.+)$ http://%1.new.com/$1 [R=301,L]

Categories : Htaccess

ASP.NET - Strange Bug in Page Redirection
If you put breakpoints in your Page_Load, Cancel_Click, and Button_SaveChanges_Click methods and debug, what I believe you'll find is your Page_Load is firing and causing the redirect due to the code in that method. You likely need to add a check to determine that it is not a postback - like so: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //current Page_Load code in here... } }

Categories : Asp Net

Codeigniter 301 redirection index.php
Try this one in .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L,R=301] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L,R=301] </IfModule> RewriteRule ^index.php?page=9-someting&txt=12$ /page/1/someting#2/other [R=301,L]

Categories : PHP

Access old site after redirection
One simple way of achieving this is by passing a secret query parameter by your client: (you can make it more complex as needed) # set a cookie only if a secret URL e.g. http://oldsite.eu?q=q1w2e3r4t5 # is passed RewriteCond %{QUERY_STRING} (^|&)q=q1w2e3r4t5(&|$) [NC] RewriteRule ^ - [L,CO=mredir:0:secret] # if cookie isn't set then redirect to new website RewriteCond %{HTTP_COOKIE} !^.*mredir=0.*$ [NC] RewriteCond %{HTTP_HOST} ^(www.)?oldsite.eu$ [NC] RewriteRule ^ http://newsite.com%{REQUEST_URI} [R=301,L] EDIT Looked at your .htaccess and I would strongly suggest you to combine your multiple Rewriterule lines. See an example below: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Rewriterule ^(index|login|register|help)$ $1.php [L,NC]

Categories : PHP

Redirection Depending Upon Url Parameter
<?php // quesry string parameters are accessible through $_GET or $_REQUEST switch($_GET['mid']) // Look only at mid parameter. Decide what to do based on value { case 1: $page = 'page1.php'; // Save the redirection to a variable break; case 2: $page = 'page2.php'; break; default: $page = 'page3.php'; break; } // redirect to correct page header('location: '. $page); ?> $_GET -- get querystring params switch -- Switch control structure header -- redirect

Categories : PHP

Should I handle redirection via PHP or Javascript?
edit First and foremost, you might want to read up some more on redirecting using header. Instead of just setting header('Location:...');, redirect using the following code: header ('HTTP/1.1 301 Moved Permanently'); header('Location:searchForm.php?ticket='.$_SESSION['product'].'&searchbtn=Search'); A 301 redirect is generally better for SEO, and most browsers will cache the redirect, so the client history stack will be more reliable, which is good news for the JS scripts that might use the history... Which is the better approach? PHP. Relying solely on JS for redirecting the client is not a great idea. Clients might turn of your script, or if some error creeps in the JS code, the redirection won't work. Some borred teen might feel like messing with your code, and find possible

Categories : PHP

alias redirection not working
That's not how Alias works. Alias maps a URL path to a physical file/directory path. This means, if you have: Alias /file1 /dir1/file1 When you go to http://sub.domain.com/file1 you get served the file on the harddrive at /dir1/file1. What you are looking for may be mod_rewrite: RewriteEngine On RewriteRule ^file1$ /dir1/file1 [L]

Categories : Apache

GAC Assembly redirection for several .dlls
Due to this article, I had to create one Policy for each combination of MajorVersion.MinorVersion of my assembly. So I had to create two policies: One to be able to redirect from 1.0.0.0 to 1.2.0.0 And another one to redirect from 1.1.0.0 to 1.2.0.0 This solution works, but if anyone knows a more efficient way to do this, I will really appreciate it.

Categories : Misc

Zend redirection of 404 page
You should take a look at Zend_Controller_Plugin_ErrorHandler. A sample usage for this plugin is to register it in the general bootstrap to redirect errors to a standard controller: $plugin = new Zend_Controller_Plugin_ErrorHandler(); $plugin->setErrorHandlerModule('default') ->setErrorHandlerController('error') ->setErrorHandlerAction('index'); $front = Zend_Controller_Front::getInstance(); $front->registerPlugin($plugin); (Example taken from the docs). Mind that, as the docs say: The ErrorHandler plugin is designed to handle HTTP 404-type errors (page missing) and 500-type errors (internal error). It is not intended to catch exceptions raised in other plugins.

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.