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
6
votes
1 answer

Setting nginx reverse proxy with rewrite to apply to all links in site

I have the following Nginx config: server { listen 80; location /test { rewrite /test(.*) /$1 break; proxy_pass "http://www.example.com/"; } } This works well for the home page and when entering 'http://localhost/test'…
adaml
  • 361
  • 2
  • 7
6
votes
1 answer

Apache's mod_rewrite and PHP's REQUEST_URI variable

I have an issue with Apache passing to the PHP $_SERVER['REQUEST_URI'] variable the URL after it has been rewritten rather than the original one requested. I am doing this rewriting because I had a WordPress website and wanted to move it to a…
Mg512
  • 61
  • 1
  • 3
6
votes
1 answer

How do I make virtual host DirectoryIndex file appear in the url?

I have setup a virtual host which specifies a default file to load when the URL is called. The problem I have is that I need that default DirectoryIndex file to appear in the URL. So when I go to: www.mysite.co.uk, I want www.mysite.co.uk/app.php to…
Bob Flemming
  • 1,245
  • 3
  • 14
  • 17
6
votes
2 answers

It it possible to have multiple ReWrite rules that all do the same Action, for an IIS7.5 webserver?

I've got rewrite module working great for my IIS7.5 site. Now, I wish to add a number of URLs that all go to an HTTP 410-Gone status. Eg.
Pure.Krome
  • 6,508
  • 18
  • 73
  • 87
6
votes
2 answers

IIS re-write from http to https only for subdomains of one domain only

I have an IIS7 web server with several sites running. Some of the sites are sub-domains of one domain and the others are totally separate domains. I want to use IIS re-write to redirect all the sub domain sites of one domain to https, but I want the…
Charlotte
  • 161
  • 1
  • 2
6
votes
1 answer

Outbound URL Rewrite rule causes 500 server error on IIS7.0

When I added User-friendly URL using IIS URL Rewrite Module 2.0 i got this server error 500. I followed the guide on official MS learn iis page. I noticed when I unchecked following option "Create corresponding outbound rewrite rule" everything…
nemke
  • 161
  • 1
  • 1
  • 5
6
votes
1 answer

URL rewrite rules lost upon restart

Every time I restart my server my URL rewrite rules seem to get reset. Recreating them every time is obviously frustrating! I am running Windows Server 2008 R2 (fully updated), IIS 7.5 and IIS URL Rewrite 2.0. Does anyone have any idea what could be…
Jonathan
  • 1,309
  • 2
  • 22
  • 29
6
votes
2 answers

IIS7 URL Rewrite breaks for URLs containing + characters

I have an IIS7 server that acts as a reverse proxy for several other web servers. The other servers run on different ports, so the IIS7 server provides 'friendly URLs' and all on port 80. URL rewriting is used to hand the request off to the back-end…
Tim Long
  • 1,738
  • 1
  • 21
  • 41
6
votes
4 answers

Apache RewriteRule for proxying

I have a web application installed (ClockingIT) that acts based on the used subdomain. As we want to use SSL and do not have a wildcard certificate, this is not very convenient for us :-) So I thought about using Apache's mod_proxy and mod_rewrite…
Daniel
6
votes
1 answer

URL rewrite with multiple parameters using .htaccess

I have four different types of rewrites I'm trying to do with multiple parameters in each. First, the URLs with no modification: http://www.example.com/index.php?p=/category/page-slug&pn=2/ http://www.example.com/index.php?p=/category/&f=feed/rss…
VirtuosiMedia
  • 183
  • 1
  • 1
  • 5
6
votes
3 answers

Apache Virtual Host Config www vs non-www, Rewrite or sServerAlias?

We have a central httpd.conf and we include confs for various virtual hosts. Until today, we didn't really have a need for "www.subdomain.site.com" domains, only "subdomain.site.com." Now we do, so I am trying to figure out which of these two…
KM.
  • 1,786
  • 2
  • 18
  • 31
6
votes
2 answers

Rewrite URL before passing to proxy Lighttpd

I'm trying to setup a reverse proxy in lighttpd, such that all requests (and only those requests) under /mobile/video is redirected to the / directory of a secondary web server. This is pretty easy in apache, but I can't for the life of me figure…
futureelite7
  • 207
  • 1
  • 4
  • 8
6
votes
2 answers

What should my Nginx rewrite rules be for Rails with Passenger for page caching in a subdirectory?

I'm using Nginx 0.7.64, Passenger 2.2.9, Rails 2.3.5. I have my page caching directory set to /public/cache, and I'd like to be able to serve cached pages when requested over HTTP, but always hit the Rails app when requested over HTTPS. The bulk of…
Ian Terrell
  • 171
  • 1
  • 8
5
votes
2 answers

How to add/ignore a subfolder in htaccess file?

I have build an app at http://url/sdf19/ I have a .htaccess placed in /sdf19/ containing RewriteRule for clean urls. But I have built a PDF generating tool, which is in a subfolder /inc/tools. I need to link to it direct to run before headers.…
Brad Sullivan
  • 51
  • 1
  • 3
5
votes
3 answers

URL Rewrite not available after installing on IIS 10

I can't seem to find anything about this online. I've installed URL Rewrite via Web Platform Installer on Windows 10 running IIS 10, restarted IIS Manager, restarted IIS Server and also rebooted my machine but URL Rewrite option is still not…
erikvimz
  • 273
  • 1
  • 2
  • 9