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.
Questions tagged [rewrite]
2112 questions
8
votes
1 answer
ProxyPass entire domain to Tomcat, including root
I have configured my VirtualHost example.com to proxy all requests to a Tomcat server
ProxyPass / http://localhost:8088/app
ProxyPassReverse / http://localhost:8088/app
This works fine for URLs like example.com/page, but for example.com and…

Bart van Heukelom
- 1,199
- 6
- 21
- 41
8
votes
2 answers
How Can I Configure nginx to Use Pretty URLs for Static Sites?
I've got several static sites (mostly generated by Sphinx), that I'm trying to host on my VPS. I've installed and configured nginx according to the guides, and I can successfully display my sites, but the issue is the URLs are absolute, and it looks…

rdegges
- 295
- 1
- 4
- 7
8
votes
4 answers
nginx subdomain rewrite
Yet another nginx rewrite rule question
How can I do a rewrite from http://www.*.domain.com to http://*.domain.com ?
thanks in advance
-- Deb
EDIT:
I'm sorry I didn't see the textile formatting removed the * from my question. I fixed it now.
What I…

deb
- 245
- 1
- 4
- 7
8
votes
9 answers
Recommendation: Company website forced to https?
My company wants their "informational" website to be rewritten from HTTP to HTTPS. Technically this is not a big deal for me. But i have doubts if this is state-of-the-art since the only reason they want this, is to encrypt contact and sign up…

zero_r
- 2,405
- 3
- 16
- 16
7
votes
1 answer
Nginx - populate REQUEST_URI with rewritten URL
I have an Nginx configuration that is for a new PHP application that has the same functionality as another legacy PHP application, but different URLs.
I want to preserve the paths of the old application, replacing the /foo path prefix with /page…

chiborg
- 1,083
- 2
- 13
- 27
7
votes
3 answers
Set header based on %{REQUEST_URI}
I am trying to set a header based on the URI of a particular page.
I access a page using chrome.
Inspect element and see that my URI header is giving the value /bst/index.html
Now in my Apache config , I want to set a Header to Yes if my…

Jason Stanley
- 91
- 1
- 1
- 4
7
votes
1 answer
Url rewriting in Amazon S3
I have a webapp hosted in Amazon S3, the webapp is build with jQuery Mobile and I use changePage lo navigate between pages, I'm not using the hash operator(#) when I change the page.
I'm having problems when the user copy the url and paste it in a…

Fernando P. G.
- 141
- 1
- 1
- 7
7
votes
1 answer
Getting "Too many redirects" error with nginx rewrite rule
I am trying to rewrite the domain url that targets my site such that all domain names are rewritten to www.example.com and have the following config:
mysite block
server {
listen 80 default_server;
listen [::]:80…

Dark Star1
- 1,385
- 7
- 22
- 37
7
votes
2 answers
nginx url rewriting. i just don't get it
Ok, an example url is
http://www.mysite.com/?p=account&view=settings
the p uri is a constant. all urls have it.
the view is one of many optional uri.
i've tried to understand url rewriting and regex, but i'm just not getting it. I need to be back…

r3wt
- 202
- 1
- 3
- 10
7
votes
2 answers
How to check if mod_alias is enabled?
I want to try mod_alias instead of mod_rewrite for a couple of simple redirect rules, but the directives don't seem to be working when entered in .htaccess. Is it possible that mod_alias is not loaded or enabled on the server?
How do I find out?

Matthew S
- 189
- 1
- 2
- 8
7
votes
4 answers
Nginx: Rewrite from base domain to a sub directory
I have a blog hosted at http://site.com/blog.
How do I instruct nginx to rewrite requests from site.com to site.com/blog?
This should not be permanent.

Quintin Par
- 4,373
- 11
- 49
- 72
7
votes
6 answers
How do I remove trailing slashes from a URL when using Apache's default directory index file?
I am using Apache to serve a blog which consists of static HTML files. Currently, the blog uses a pretty standard URL structure, like this:
/2010/03/21/my-awesome-blog-post/
which maps to the file
/2010/03/21/my-awesome-blog-post/index.html
using…

mipadi
- 315
- 2
- 3
- 11
7
votes
1 answer
IIS 7.5 Redirect / URL Rewrite to mobile version of website
I'm looking for an IIS solution (not programming) to redirect a website to a mobile version of the website. It looks like it might be possible, but not sure, with IIS Redirect or using IIS URL Rewrite 2.0. If this is the case how would one go about…

thames
- 955
- 3
- 10
- 20
7
votes
3 answers
Apache 2.2 rewrite - Force all requests to index.html
I need to force all requests regardless of what they are to index.html. Unfortunately everything I have tried has not worked properly.
The following seems to me like it should work but it doesn't. My understanding is that it is saying for anything…

daemonofchaos
- 1,211
- 1
- 8
- 10
7
votes
2 answers
How to port Apache rewrite rules to cherokee?
I'm pretty new to cherokee, it's great and pretty straight forward except URL Rewrites. Is there a straight forward guide to it? Let me know.
Also how would I port this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond…

0xdeadbeef
- 397
- 6
- 13