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)

-3
votes
2answers
266 views

How do I redirect .php pages to .html pages? [duplicate]

Possible Duplicate: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? I have a dynamic website, so all the pages are in .php, but I want to show an address ...
7
votes
1answer
3k views

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 ...
9
votes
4answers
13k views

nginx + PHP-FPM = “permission denied” error 13 in nginx log; configuration mistake?

I've got nginx 0.7x + PHP-FPM running under PHP 5.2.10 on one RHEL5 server, but trying to duplicate that setup under the bundled-in PHP-FPM in PHP 5.3.3 on a second server, I'm having some trouble ...
6
votes
3answers
7k views

How to rewrite the domain part of Set-Cookie in a nginx reverse proxy?

I have a simple nginx reverse proxy: server { server_name external.domain.com; location / { proxy_pass http://backend.int/; } } The problem is that Set-Cookie response headers contain ...
15
votes
5answers
1k views

How can I enforce that my urls always start with www?

I want to ensure that users come to www.mydomain.com even if they arrive through the alias mydomain.com. This is so that I have control over cookies on subdomains, and so that Google sees one single ...
3
votes
2answers
1k views

Apache-style multiviews with Nginx

I'm interested in switching from Apache/mod_php to Nginx for some non-CMS sites I'm running. The sites in question are either completely static HTML files or simple PHP, but the one thing they have in ...
2
votes
1answer
2k views

How to use Apache to proxy from subfolder to other server

Given the following url: domain.com/wiki/ I'd like apache to redirect all requests below that (so domain.com/wiki/*) to otherdomain.com:8080/. But the trick is I want the user to always see ...
6
votes
4answers
3k views

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 ...
3
votes
2answers
238 views

Is there an Elegant solution to rewrite long image?query-urls into cachable_nice_urls, using only apache htaccess?

this is a pain in the ass-problem! Whicever genius solves this riddle will receive paypal donation to eat diner for two. Now lets get started. Given: most proxies, do not cache resources with a "?" in ...
3
votes
4answers
5k views

How to redirect non-www to www without hardcoding using .htaccess?

RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] ...causes a perfect, non-hardcoding 301 redirect from "www to non-www", ...
4
votes
4answers
13k views

How do you configure IIS 7 to use a subdirectory as the default document?

So I have a website running on a discount asp.net account, and I put an asp.net mvc app in a subdirectory. If my url is 'www.website.com' and my app is in directory 'sample', then ...
1
vote
1answer
366 views

Using Virtual Domains with WordPress and Cherokee Web Server

I'm trying to configure WordPress to work with Cherokee Web Server. The multi-site set up in WordPress is yyy.com and uses 'sub-domains'. Thus, I have sites like aaa.yyy.com, bbb.yyy.com - they all ...
5
votes
2answers
2k views

nginx case insensitive rewrite

I am trying to make my nginx redirects as clean as possible. I understand ~* is for case insensitive but I can only get it to work in example 2. Example 1 rewrite ^/foobar ...
6
votes
2answers
5k views

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 ...
2
votes
1answer
5k views

nginx- Rewrite URL with Trailing Slash

I have a specialized set of rewrite rules to accommodate a mutli site cms setup. I am trying to have nginx force a trailing slash on the request URL. I would like it to redirect requests for ...
1
vote
1answer
3k views

Hide path to backend with Nginx

I have OpenNMS running on host B-beta with the following URL: http://b-beta:8980/opennms I would like to use NginX to hide this path accessible from host a-alpha like this: ...
0
votes
1answer
206 views

Compact Redirects in Apache/htaccess. How? [An Elegant Coding Question]

when setting my redirects in htaccess, i have trouble setting/combining various domains when they all go to the same homepage. I can do them separate, but that isn't neat/elegant. How to rewrite the ...
0
votes
1answer
196 views

url rewrite to make generated thumnails cache like static, a syntax question

this is a pain in the ass-problem!! Given: most proxies, do not cache resources with a "?" in their URL even if a Cache-control: public header is present in the response. To enable proxy caching for ...
4
votes
1answer
2k views

How to extract Only the file name from the request uri

I am trying to rewrite the request uri depending on the extension of the file, then extract only the file name from the uri and store it in another folder. The problem here is no predefined variable ...
4
votes
2answers
4k views

Redirecting to the IP of an amazon EC2 instance

As you know amazon EC2 instances get an address like: ec2-72-44-40-153.z-2.compute-1.amazonaws.com If I have the domain example.com, is there any way that I can make bob.example.com or preferably ...
3
votes
1answer
56 views

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. ...
3
votes
1answer
791 views

Apache mod-rewrite rule to change subdomain.domain.tld to domain.tld/subdomain

What would the rewrite rule be to change subdomain.domain.tld to domain.tld/subdomain? Or should I look at a VirtualServer directive to take subdomain.domain.tld and serve it from a DocRoot that ...
3
votes
3answers
3k views

Nginx rewrite urls without redirection

I used rewrite directives below in nginx to rewrite urls of static files to external CDN server. rewrite ^/static/(css|images|js)/([a-z_\-\.]+)$ http://cdn.domain.com/$1_$2 last; It works but it ...
3
votes
2answers
2k views

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 ...
2
votes
1answer
5k views

URL rewrite with multiple parameters using .htaccess

I've been trying to create some rewrite rules for the last few hours and I'm failing miserably. If anyone could help, I would be extremely grateful. I have four different types of rewrites I'm trying ...
2
votes
2answers
705 views

Order of mod_rewrite rules in .htaccess not being followed

We're trying to enforce HTTPS on certain URLs and HTTP on others. We are also rewriting URLs so all requests go through our index.php. Here is our .htaccess file. # enable mod_rewrite RewriteEngine ...
1
vote
1answer
111 views

Nginx and Wordpress permalinks are broken if blog is not in root

So I have installed nginx and Wordpress on my server. However, my blog is not in domain root. (e.g. example.com/blog and contents are in /var/www/example.com/blog) I am using settings below in nginx ...
1
vote
0answers
210 views

How to deal with certain characters in IIS URL Rewrite

I had a question on how to rewrite a url and had a great answer on the site, and it worked, but there is some characters that I can't find how to encode and iis doesn't like at all The original ...
1
vote
3answers
181 views

Tell nginx to SSL encrypt specific PHP documents

I have set up my server with the following settings: server { server_name www.example.com listen 443; listen 80; location /login\.php { rewrite ^(.*) ...
1
vote
1answer
169 views

URL ReWrite for Windows Server (IIS)

Yesterday, I asked for help on urlrewrite - Ulrich Palha helped me to solve the problem. His solution is working great on Linux server using .htaccess, and I appreciate his help, but the solution ...
1
vote
1answer
5k views

How to quick and easy remove part of an URL in Nginx with HttpRewriteModule?

I know about the HttpRewriteModule, but I don't really know how to handle regex and I would need to redirect all URLs within a certain directory to another, specifically ...
1
vote
0answers
358 views

lighttpd 1.5 reverse-proxy to trac

I'm running lighttpd 1.5 freshly compiled off svn. I have a trac daemon listening on port 8000 and I want to proxy all requests matching ^http://xx.xx.xx.xx/trac(*.) to that daemon. Here is what it ...
1
vote
4answers
423 views

How many rewrite rules should I expect to manage? [closed]

I'm dealing with a hosting team that is fairly skittish of managing many rewrite rules. What are your experiences with the number of rules your sites are currently managing? I can see dozens (if not ...
1
vote
2answers
3k views

CakePHP in a subdirectory using nginx (Rewrite rules?)

I managed to get this to work a while back, but on returning to the cakephp project I had started it seems that whatever changes I've made to nginx recently (or perhaps a recent update) have broken my ...
1
vote
1answer
1k views

IIS7 URL Rewrite and Symbols

I'm migrating from IIS6 with ISAPI_Rewrite to IIS7 using their Rewrite module. I have a "pretty" url that looks like this: /Shop/Q%26A. Of course that it Q&A encoded. IIS7 doesn't seem to like it. ...
0
votes
1answer
449 views

RewriteBase rule works in .htacess, but not in httpd.conf (inside <Directory …>)?

Let me explain by example... File: /var/www/example.com/public/wp-content/cache/minify/.htaccess <IfModule mod_rewrite.c> # THIS WORKS... RewriteBase /wp-content/cache/minify/ ...
0
votes
1answer
107 views

DNS and URL Mapping

I have content which is hosted on serverA.com/site, however, when a user visits serverB.com/sitename, I would like it to load the content of serverA.com/site (while the url is sitll on serverB). Is ...
0
votes
3answers
160 views

How to redirect the url of old modified directories

I have a website for classifieds ads. Before I used to modify the URLs to make them more appropriate, but the old URLs are still showing up in Google index and in browser history/bookmarks. Is there ...
0
votes
2answers
7k views

Using IIS 7.5 URL Rewrite, how can I redirect all requests not from a particular subdomain to a specific page?

I'd like to use the URL Rewrite module in IIS 7.5 to redirect all requests not from a particular sub-domain (x.domain.com) to a specific folder/file. For example, these should work as-is: ...
0
votes
1answer
196 views

nginx extending a rewrite rule with a condition

I have the following rewrite rule, used for WordPress Network to handle the file requests: location @rewrite { rewrite ^/(.*)$ ...
0
votes
3answers
258 views

nginx rewrite for wikkawiki

Just setup WikkaWiki on my server, I have been trying to have the links go from wiki.mysite.info/wikka.php?wakka=Start into wiki.mysite.info/DotMG. I tried following their guide at ...
0
votes
1answer
130 views

Subdomains from folders on Apache

I have a website on localhost, mapped in HOSTS as: 127.0.0.1 www.yorkshiretestingwebsite.com 127.0.0.1 yorkshiretestingwebsite.com However, the folder (C:/www/vhosts/yorkshiretestingwebsite.com) ...
0
votes
1answer
1k views

PHPMyAdmin 500 Internal Server Error

My home PHPMyAdmin was working fine a day or two ago. Now it's giving me a generic 500 Internal Server Error and suggesting I look at my server logs. The Apache log contains these error messages: ...
0
votes
2answers
394 views

Infinite loop when putting rewrite into Directory context in Apache

I want to redirect www.example.com/foo to www.example.com/bar/index.php/foo So I have the rule (mod_rewrite) <Location /> RewriteEngine on RewriteRule /(.*) /bar/index.php/$1 [L] ...