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
1answer
112 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
173 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
125 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
166 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
130 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
136 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
160 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
685 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
306 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
45 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
139 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 ...
0
votes
0answers
53 views

Trailing slash added when symlink matches directory name

I have a rule which rewrites my shop url (http://mydomain.com/shop) to a symlink (/var/www/shop). I've noticed that if the url subdirectory matches my symlink name (shop/shop), Apache enforces a ...
0
votes
1answer
47 views

Error in rewrite uri with nginx

Here is the error we have when loading nginx on ubuntu 12.04 server: nginx: [emerg] invalid number of arguments in "location" directive in /opt/nginx/conf/nginx.conf:58 What we are trying to do is ...
0
votes
1answer
313 views

Nginx Rewrite with a question mark

I am trying to force Nginx to redirect/rewrite one URL that uses a query string /?cat=20 to /category/lighttpd/. Here is what I tried, which is not working: location ~ /\?cat=20 { rewrite ^ ...
1
vote
3answers
95 views

Apache rewrite http request to https

I have an apache server v2.2, with a virtual host on 80 and another with SSL on 444. I would like to redirect all this kind of request: http://domain.tld:444/dir1 http://domain.tld:444/dir2 ...
0
votes
1answer
71 views

After rewriting, nginx doesn't use php-fastcgi

I'm having trouble with an nginx rewrite. I want to rewrite ^(.*?)/(.*?)/?$ to controllers/$1.php?action=$2. This worked for me on an Apache server earlier. After that, I want to route that file to ...
-1
votes
1answer
20 views

URL redirection [duplicate]

I have set up a ubuntu server with apche 2 installed, I already have a windows server 2003 installed with Zywall firewall installed, I successfully started Apache2 in Ubuntu server and it is running, ...
1
vote
1answer
340 views

Nginx and If-Modified-Since/If-None-Match headers

Anyone know how to rewrite this apache rule for Nginx? RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}] RewriteRule .* - [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}] Thanks
0
votes
1answer
92 views

Problems with Rewriting URLs having fcgid enabled

First some information about my server: Apache2 Version: 2.4 Modules: php5 : disabled; rewrite : enabled; suexec : enabled; fcgid : enabled; Php Version: 5.3.3 I am currently creating a website ...
-2
votes
1answer
23 views

How do I get apache 2 to serve up home directory? [closed]

I have a domain name I have registered and it is currently showing the Apache 2 Test Page from the /var/www/html/ directory, I was wondering how I can get it to point to a home directory instead ie: ...
-1
votes
1answer
142 views

Using URL Rewrite to change part of URL

I'm trying to use an URL rewrite on an IIS 8.0 to rewrite existing URL's on a developer machine. The reason for this is that I don't want to change existing (old) code. What I'm trying to achieve is ...
0
votes
1answer
387 views

Zend Framework won't work for URLs with trailing slash — how to configure nginx to rewrite URLs properly?

I am setting up an nginx server to be used with the Zend Framework. For the most part it works. However, if there is a trailing slash on the end of a URL, for example http://localhost/test/ vs ...
1
vote
1answer
56 views

nGinx Redirecting to https:// on all URL

I am trying to get the following to work so that no matter what you type in the URL bar you always go to "https://www.". So far www. does not go to https://www. and https:// does not go to ...
0
votes
2answers
51 views

RewriteRules not stopping with [L] flag?

A simpel mod rewrite in .htaccess. If I open for example /lib/js/core/jquery.min.js, Apache2 takes the last rule and not the first. How can I fix this? RewriteEngine on RewriteRule ...
0
votes
1answer
219 views

htaccess subdomain Redirect issue

I am trying to build a wordpress site with mobile. I have set the sub-domain in httpd.conf and htaccess. now i add some custom search in a e:\wp\custom\ folder, another mobile custom search in ...
0
votes
2answers
72 views

.htaccess - complicated conditions

I've been trying to wrap my head around .htaccess for most of the weekend, but I keep stumbling; I can get the server to work with one set of rules, but no more than one at a time. My application is ...
0
votes
2answers
47 views

Advice on mod_rewrite url in Apache

I'm trying to set up a mod_rewrite rule so that when the webpage www.mysite.com/blog is requested a page from the blogging service Tumblr is loaded. I have set up my Tumblr site so that ...
0
votes
1answer
19 views

nginx load different files if varibles

I want to server up landing.html if they come without any url parameters and send them to app.html if they do. I would think this would work but it tells me I can't try files within that block. ...
1
vote
1answer
2k views

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: ...
0
votes
1answer
438 views

Nginx rewrite rule - appending language prefix

I have a site spanish.com. I want users to load pages under "es" directory, i.e., spanish.com/es. For example: Users should see: spanish.com but spanish.com/es is loaded Users see ...
1
vote
0answers
35 views

How do I make nginx rewrite requests to a different server (which is in the same config)?

I am trying to achieve the following: Some files on my server should be served from a subdomain (static.example.com) for performance purposes (avoiding cookies). However, some of the content is ...
3
votes
1answer
50 views

Nginx directory post

THere is a piece of legacy code I'm working on, I can't alter where it POSTs to so I just need to figure a way around it. THe bit of Javascript makes a post as follows - POST /authentication/login/ ...
0
votes
1answer
60 views

Converting .htaccess to nginx

RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) p.php?id=$1 [L,QSA] How would I change that to work with nginx? Also, where do I place ...
1
vote
2answers
594 views

nginx redirect to www.domain

I want to redirect the site ALWAYS to www.site.com. However, I am not sure as to how to get the WWW to always show up in front should say someone type in the domain without the www. EDIT: server { ...
0
votes
0answers
171 views

Outgoing IIS URL Rewrite Rule

I have the following outgoing IIS URL rewrite rule: <outboundRules> <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1" enabled="true"> ...
1
vote
2answers
989 views

How to configure apache as a reverse proxy with the remote server specified in a query string parameter

Problem: I'm trying to configure apache as a reverse proxy where the remove server is specified in a query string parameter. Let's say I'm serving a site at mywebapp.com. If you navigated to ...
0
votes
3answers
3k views

How do I make RewriteCond %{HTTP_COOKIE} match a cookie value exactly? [duplicate]

How do I make my rule match an exact value of a cookie? I've tried: RewriteCond %{HTTP_COOKIE} ^its=me$ [NC] RewriteCond %{HTTP_COOKIE} its=^me$ [NC] RewriteCond %{HTTP_COOKIE} its="me" [NC] ...
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 ...
0
votes
0answers
33 views

Redirect switcharoo - Apache

I'm having trouble making this or some variant of it work: <IfModule mod_rewrite.c> RewriteEngine On <DirectoryMatch "/home/.*/public_html"> RewriteRule /wp-login.php - [F] ...
1
vote
4answers
92 views

apache rewrite rules https to directory

I want apache to: redirect http users to https if they access http(s)://example.com/1234 redirect to /view/1234 I have tried different flavours but cannot get it work. When a user access the ...
0
votes
4answers
2k views

Redirect url for Microsoft RD Web (Server 2012)

I have installed RD Web on the same web server as OWA and ECP (Exch 2013) console. All web applications are installed in the Default Web Site and Exchange Back End For OWA and ActiveSync my users ...
1
vote
1answer
513 views

URL rewriting between different pools with different authentication in IIS

I have an IIS application and three sub-applications as follows: CMT (Windows and Anonymously authenticated) - CI - EM - Website (Windows authenticated) CI and EM are helper web services and ...
0
votes
1answer
44 views

nginx rewrite in proxy_pass

I need proxing to different backend but whith same url, so rewriting thould be like this URL: http://myservrer.com/server/monitoring1?(parameters) REWRITE TO: ...
0
votes
1answer
138 views

apache rewriterule for querystring parameters

The code below builds a url in this form. http://mysite.com/browse/department/?pid=1 and here is the rewrite cond and rule RewriteCond %{QUERY_STRING} ^pid=([0-9]+) RewriteRule browse/(.*)/$ ...
0
votes
1answer
260 views

apache simple rewrite rule or rewrite condition for query string

Im trying to add a rewrite rule to my htcaccess file and the part Im having trouble wth is the query string. I want to add the query string parameter pid to the rewrite rule. Both lines of code don't ...
0
votes
1answer
42 views

Rewrite not displaying image resources on web page

I have an Apache 2.4 server running on Windows 2008 R2 as a reverse proxy and I wanted to be able to display a page that shows that a server (one of the virtual hosts) is down for maintenance. After ...
0
votes
0answers
51 views

Apache mod rewrite, virtual host or both to map domain path of remote sever to local?

I have a PHP application on my server that my client wants to access with their domain. I have many of these so I will give a generic example: www.mydomain.com/app1/method1/function/args_string ...
0
votes
1answer
277 views

how to make a url rewrite rule exception?

I have a bunch of rewrite rules to redirect visits from domainX to domainY, however now I want show an index.html page when people visit domainX, but I still want all the other rewrite rules to apply. ...
0
votes
1answer
145 views

URL Rewrite and Masked Redirection

I have a site that is actually a tumblr account for a client. I need to set it to that: blog.foo.net actually redirects to blah.tumblr.com, while still using blog.foo.net. This would be simple using ...