Tagged Questions

URL Rewriting maps an incoming URL to a modified URL, so that the request is processes as if the original request was made to the modified URL. This is often used to provide more search engine friendly URLs.

learn more… | top users | synonyms (5)

0
votes
2answers
292 views

nginx serving alternate location on 404

I'm trying to set up an nginx config as follows: When receiving a request like /tile/SteveCountryVic/1/2/3.png: Attempt to pass it through to http://localhost:5005/1/2/3.png If that 404s, pass it to ...
0
votes
1answer
794 views

nginx serve static files directly if not matched by rewrite rules

I just moved from apache to nginx and I'm struggling with some configuration settings that doesn't seem to work. I have these rules from my previous .htaccess file that I'm trying to convert to nginx ...
2
votes
1answer
1k views

My nginx rewrite is downloading the php file

I have the following rewrite rule I'm trying: location / { index index.php index.html; rewrite ^/test$ /test.php break; } And I ...
1
vote
1answer
132 views

Nginx not sending auth headers when redirecting to a different domain

I have the following setup: server { server_name some.server; location / { rewrite ^ https://otherserver.com permanent; } } The redirect works as expected, but the ...
2
votes
1answer
577 views

Can a URL Rewrite condition compare two server variables?

I am trying to compare two server variables as part of a URL rewrite condition. But first, some context... In IIS, if you request http://www.example.com/foo and foo is a directory, IIS sends a 302 ...
1
vote
0answers
36 views

Redirect subfolder to subfolder and remove subfolder via nginx

I'm trying to redirect a subfolder to another subfolder with nginx. The hard part is removing the target subfolder from displaying, as it's a ruby app and not a true root folder. They are both on the ...
0
votes
0answers
69 views

How do you exlcude a sub-directory from an Apache rewrite ruleset?

I have a multilingual site with the root being English and a sub-directory (/es/) being a human translation into Spanish. Instead of manually updating all URLs, I have a opted to use mod_rewrite to ...
1
vote
1answer
328 views

nginx: rewrite subdomain to subdirectory without redirect

I'd like nginx to rewrite any http://api.example.org/xyz requests to actually call example.org/api/xyz behind the scenes. The tricky part too is that I'm using CodeIgniter so rather than load a php ...
1
vote
1answer
37 views

IIS 7 Exact Match Rewrite

I'm trying to setup a rewrite for my site. I've fiddled with this for days but can't get it to work right. Here is what I'm looking for: Original URL: site.com/searchresults.aspx?categoryid=6 ...
0
votes
2answers
36 views

Apache to Nginx rewrite rules

I have Apache rules for a Web application that look like so: RewriteEngine On RewriteRule ^unsubscribe/([-A-z0-9]+)/?(.*)$ /list/unsubscribe.php?id=$1&why=$2 [L,QSA] RewriteRule ...
1
vote
0answers
260 views

How to create an nginx rewrite to timthumb.php

I have a website that has many custom image sizes. I'm following this example which uses apache but I need to recreate this on an Nginx server. ...
0
votes
0answers
202 views

conditional location using nginx

I'm running a forums site behind cloudflare and I'm trying to make my location statements more efficient but I'm not really sure what I'm doing. I read nginx extending a rewrite rule with a condition ...
3
votes
2answers
418 views

Apache configuration - rewrite rule for all virtual hosts

I have the following configuration with 2 virtual hosts on my Apache: www.domain.com and res.domain.com. The first one is open the second is limited to registred users. <VirtualHost *:80> ...
0
votes
1answer
356 views

rewrite engine: How to test if URL on different server is reachable?

I am trying to use the rewrite engine of nginx to redirect requests. On the same machine I have a Jetty running on port 8080, which is delivering some content. I want to check if the content is ...
0
votes
0answers
41 views

URL rewriting not working in apache2/ubuntu

I need to redirect my request from one url (/var/www/imgservice/test.php) to another URL (/A/B/C) where A,B and C are folders. I am currently on Ubuntu 12.04.2 LTS and my DocumentRoot is /var/www/ I ...
1
vote
2answers
129 views

htaccess with multiple parameters

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !\.php$ RewriteRule ^(.*)/(.*)/(.*)$ $1.php?Action=$2&id=$3 RewriteRule ...
0
votes
0answers
115 views

nginx drupal config, webalizer statistics folder 404

I'm having trouble accessing the stats sub-directory and get a 404 page not found. The file is there, I believe it has to do with the redirect for clean URLs for Drupal. The folder is there and the ...
2
votes
0answers
214 views

nginx/php + zurmo, rewrite or internal redirection cycle

I am trying to get Zurmo CRM running on my Debian Jessie system on localhost. I couldn't find an example nginx config and the application needs to rewrite URLS, which I have done wrong. I also use ...
0
votes
1answer
171 views

How to change URL parameter using transparent proxy

I have a subnet of computers connected to Internet through a router (which could be a HTTP proxy as well). My goal is to change URL parameter for a one single URL. If users go to ...
1
vote
0answers
263 views

Possible bug in IIS url rewrite module or is it just me?

Okay, so I came up with the brilliant idea to run a W2012 IIS8 with rewrite rules to do some reverse proxying for me, not because it's the best choice, but because I didn't want yet another box ...
0
votes
0answers
34 views

Nginx rewrite problems with special chars

I'm trying to do following rewrites, but looks like they are not working (because of the + sign)? rewrite ^/test/emo+test(.*) /test/alternative$1 permanent; (notice the + sign) rewrite ...
1
vote
1answer
130 views

RewriteCond always match incorrectly

If I write: <?php echo "SCRIPT_NAME: ".@$_SERVER['SCRIPT_NAME']."<br />"; ?> SCRIPT_NAME: /index.php The line above is showed. I'm using these rewrite lines RewriteCond ...
1
vote
1answer
34 views

Nginx rewrite issue

I would like a particular configuration for one of my virtual servers but I have a problem explaining that to Nginx :) Its quite simple. If the URI looks like ...
0
votes
0answers
21 views

Accessing IIS from internal IPs

I have a small webserver set up running Windows 8 Pro and IIS 8. One can access the site from the external domain easily enough, but accessing it internally becomes a chore given the fact that I want ...
2
votes
1answer
190 views

Nginx Googlebot rewrite rules failing with 404

Our site is based on Angular which makes it almost completely JavaScript based, therefore we need to serve static HTML snapshots to the Googlebot in order for it to crawl us. At the moment, we have ...
0
votes
1answer
1k views

Nginx Rewrite - How to redirect url for certain file type?

My current bargain CDN has very poor performance on video caching. What's worse, I don't have any access to its setting. So I am wondering is it possible to rewrite the url for certain file type to ...
0
votes
2answers
4k views

Removing php extension with .htaccess does not work

I use the following code on my site elixnews.com to remove php extension from: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
0
votes
2answers
355 views

HTTP redirect with IIS 7.5

I have two intranet ASP.NET MVC web applications hosted in one website which could be accessed by the paths: localserver/old and localserver/new. I've moved logic from the first app to the second app ...
1
vote
2answers
144 views

Rewrite rule in nginx

I'm moving a PHP application from Apache to Nginx, using php-fpm. I'm almost done, except by a rewrite directive that I haven't been able to do in Nginx. The following is the excerpt from the Apache ...
1
vote
1answer
237 views

Nginx and Codeigniter rewrite error

I am trying to get a site on nginx running based on codeigniter. Some parts work but some fail. I noticed in access logs that index.php sometimes has two slashes at the end insted of one I am also ...
0
votes
1answer
161 views

.htaccess URL rewrite to upper-case characters in domain

For example, I'd like to have foobar.com show FooBar.com This almost works, but ends up forcing a redirect loop: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?foobar.com\.com RewriteRule ^(.*)$ ...
0
votes
1answer
48 views

URL Rewrite http to https with www

I have a domain with several apps. All apps should be reached like this. https://www.website.com/app1/ https://www.website.com/app2/ https://www.website.com/app3/ The problem I'm having is with my ...
1
vote
1answer
98 views

Preserve URI with nginx rewrite directive

I am new to nginx, I have rewrite directives to redirect hostnames to other hostnames. I want to preserve the URI in the request to the redirect so for example http://www.johntate.org/blog goes to ...
1
vote
1answer
64 views

Odd rewriting behaviour of IIS

I've also asked this question on Stackoverflow, but I thought this would've been a better place to ask. We have the following rewrite rule on IIS7.5: <rule name="Anything else to the event ...
1
vote
1answer
107 views

Application Request Routing on a hyper-v guest intermittently stops

Short description: I'm having a weird problem configuring ARR on a hyper-v guest. I can load my DotNetNuke/ASPx sites normally, but after some time of inactivity, the pages are not loaded anymore. ...
1
vote
0answers
26 views

How do I write this .htaccess rule?

I'm having trouble constructing a RewriteRule in .htaccess to redirect http://edgerank.net/%22%20%5Cl%20%22What-is-EdgeRank to the root of the domain I think the issue is that I'm not escaping ...
0
votes
1answer
59 views

Individual webconfigs for subdomains in IIS7

We are currently running one domain with many subdomains for individual clients. These clients all have their own wishes for rewriting rules, and we would like to seperate these rules for each ...
0
votes
0answers
233 views

IIS Reverse Proxy to a Jetty Server

I have an application that I have to do some integration with that is using the Jetty web server. The company that makes the application gave me instructions on how I could use IIS to act as a reverse ...
0
votes
2answers
134 views

How to get IIS8/Server2012/Azure to drop URLs such as *.php without generating a 404?

I have been using a URL rewrite script since IIS7. This snippit from my worked/works fine on IIS7.5; <rewrite> <rules> <!-- Bad Unused Nuisance URLs --> <rule ...
0
votes
2answers
223 views

NGINX rewrite for vanity URLs when file doesn't exist (try_files and rewrite together)

I'm trying to get vanity URLs on my server. If the file path from the URL doesn't exist, I want to rewrite the URL to profile.php, but if my users have periods in their usernames, their vanity URL ...
0
votes
2answers
164 views

How to simulate Apache [END] flag on a redirect?

For business-specific reasons I created the following rewrite rule for Apache 2.2.22 (mod_rewrite): RewriteRule /site/(\d+)/([^/]+)\.html /site/$2/$1 [R=301,L] Which if given an URL like: ...
0
votes
2answers
41 views

URL rewriting with nginx

I've recently set up a virtual host using nginx. The website being hosted needs to redirect URL's containing '/old/' - to the same url without '/old/'. For example: www.mywebsite.com/old/a/b/c to ...
0
votes
0answers
217 views

Nginx reverse proxy with rewrite

I'm trying to come up with a configuration for utorrent server using nginx. Here is what I have so far: server { # etc... location /utorrent { proxy_pass http://127.0.0.1:8080/gui/; ...
2
votes
3answers
134 views

What is wrong with this apache URL rewriting rule?

I would like to redirect http://abc.xyz.ac.uk/folders/abc/lmn http://abc.xyz.ac.uk/folders/abc/lmn.html Here is the code where I am enabling this <Directory /var/www/folders> ...
1
vote
0answers
151 views

Prevent Google Image Search hotlink with Nginx rewrite

Google Image Search have the ability to point to the original image without displaying the website that's hosting the image. So I want to redirect those requests to a custom page of my site. ...
0
votes
1answer
243 views

Having twice a “location / {}” block in nginx

For all our sites we have an include file which contains several things, amongst this line: location / { try_files $uri /index.php?$query_string; } For a single site, we do want to redirect ...
0
votes
2answers
778 views

Server, Database or Code Issue? Magento backend rewrites itself with a index.php which doesnt work

I will be honest and admit my cross posting in magento.stackexchange.com but the reason is that I believe it is a server fault, and now I am looking for proof to present to my dreaded hosting ...
1
vote
3answers
577 views

nginx: How to redirect root to subdirectory while maintaining URL in the address bar

I have an nginx setup with folder structure like this: - www |- splash |- blog www is the root folder. I would like to redirect users who access http://mysite.com to the splash folder. But I don't ...
0
votes
1answer
48 views

Tomcat / httpd URL Mapping

My application is running in Tomcat. If you go to http://realtimerater.com:8080/rtrSite it all works perfectly. I'm trying to get it to work for realtimerater.com. I tried to use the example that was ...
0
votes
0answers
157 views

Is there a way to get a password from HTTP authorization header in mod_rewrite (apache2)

I'd like to parse HTTP authorization header in mod_rewrite - to be able to use login and password for another redirect. I want to achieve something like this: user puts ...