Questions tagged [rewrite]

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.

2112 questions
3
votes
2 answers

Apache to Nginx Conversion (Newbie)

I've got a Nginx Web Server Setup with PHP and I want to move on Nginx and I want to convert these .htaccess rules to nginx.conf file: RewriteRule ^blog(|/)$ /data/core/site/blog.php RewriteRule ^blog/post(|/)$ /data/core/site/blogpost.php So far…
user3052975
  • 101
  • 6
3
votes
1 answer

IIS 7 Redirect from HTTP to HTTPS fail with ampersand in URL

IIS 7 on Windows Server 2008 R2 SP1 I have added the following rule to my web.config to redirect all incoming request to HTTPS
3
votes
1 answer

Should I use rewrite or return or proxy_pass in nginx?

The Apache documentation pretty clearly states that mod_rewrite should only be a last resort. For nginx, the Pitfalls section has examples where the request_uri is essentially unchanged. The situation is this: We (a department in an institute)…
muru
  • 589
  • 8
  • 26
3
votes
1 answer

Nginx rewite rules 403 error

I am having trouble with converting .htaccess files to nginx. I have 3 .htaccess files. The first .htaccess file is located in the document root and is as follows: Options +FollowSymLinks RewriteEngine On RewriteRule ^img-(.*)\.html img.php?id=$1…
Adrian
  • 67
  • 3
  • 8
3
votes
2 answers

Serving multiple directory in one path/location with nginx

I have been trying serve multiple directories in one location so that all files can be access on /sys/assets/--FILE-- regardless of where is the file physically locate in the following folder location /sys { alias…
johndavedecano
  • 133
  • 1
  • 1
  • 3
3
votes
2 answers

nginx rewrite regex for API versioning

What I want is for the first to be turned into the second.. /widget => /widget/index.php /widget/ => /widget/index.php /widget?act=list => /widget/index.php?act=list /widget/?act=list =>…
MSpreij
  • 85
  • 1
  • 9
3
votes
1 answer

IIS web.config Old URL to New URL redirects

I'm new to redirects and having a hard time getting these to work, I have about 1400 URL's from an old site that need to redirect to a new site, same domain name, but different folders and domain strings. Here's what I have that currently does not…
user221535
  • 33
  • 1
  • 3
3
votes
2 answers

How to add rewrite rule for redirecting url in Apache Web Server

I am trying to configure autodiscover feature of outlook and thunderbird for my mail server. I have added a virtualhost entry with following RewriteRule to redirect config-v1.1.xml to thunderbird.php and autodiscover.xml to…
gaurav9
  • 33
  • 1
  • 2
3
votes
1 answer

IIS Reverse Proxy Not Working With Response.Redirect() in ASP.NET

I am trying to set up a reverse proxy, using the tutorials here, here and here. The site is set up on localhost:8080, with the reverse proxy using localhost:8080/myProxy. When dealing with standard links, all is fine. I can view the proxy url and…
JsAndDotNet
  • 181
  • 1
  • 8
3
votes
1 answer

Rewrite on root of domain only in nginx

I've got YOURLS server running to host short urls for my company, so that we can provide short URL's to our customers. I'm using nginx, and for root of the domain, if they aren't using a proper short url I want to redirect to our website. So…
user217761
  • 33
  • 1
  • 1
  • 3
3
votes
1 answer

How can I reduce the response buffer size of the reverse proxy?

I have configured some reverse proxies in order to map some HTTP audio streams that are normally accessed via different port numbers (e.g. http://fooserver:18030), to URL addresses accessible on standard port 80 (e.g.…
sgorozco
  • 33
  • 1
  • 7
3
votes
1 answer

Nginx redirect all subfolders but the folder itself

I have a weird clash of names for a Wordpress installation, and I need to write a couple of Nginx rules to fix it. I used to have my software projects listed in the Wordpress page /projects, with links to sub-pages /projects/aprojectname,…
user82751
3
votes
1 answer

Multiple rule Apache rewrite

I am trying to set up a hierarchy five levels deep with mod_rewrite. This is what I have put together at this point. It works for the last two levels (the first and second rule) but not after that. Any help would be well appreciated. RewriteRule…
xxx
  • 33
  • 5
3
votes
2 answers

Apache2 mod_rewrite + userdir

I have an Ubuntu Server (web) with the following configuration Version: 13.10 Installed: Apache2, apache2 utils, php5 Enabled: rewrite, userdir Problem When I try to use rewrite rules, for example foo.bar.com/~«user»/page, I get The requested URL…
erdemkeren
  • 127
  • 1
  • 8
3
votes
2 answers

Using IIS7 as a reverse proxy

I'm setting up a server at home to host a few small websites. One of them is .NET based and needs IIS, the others are PHP based and need Apache. So, I have both IIS 7 and Apache 2.2.x installed on my server with IIS on port 80 and Apache running…
Eric Petroelje
  • 771
  • 6
  • 12