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
13 views

Nginx rewrite issue with sub folder

I'm try to redirect an URL but nothings happen. :( The source URL example like this: http://example.com/download.php?shortURL=MJdcqV Where the MJdcqV is a variable parameter, all others constant. I ...
0
votes
1answer
18 views

nginx geoip redirect for first time only leads to redirect loop

I'm trying to configure nginx to perform geoIP checks on first-time visitors only. The idea is that first-time visitors should be redirected to the page version which has been customised for their ...
0
votes
1answer
16 views

IIS 8.5 URL Rewrite just wont work: rules have no affect at all

I am trying to set up http to https rewrite in IIS 8.5 using the Rewrite module. Absolutely nothing I have tried has any affect whatsoever. The URL is of the form: http://users-dev.somedomain.com. The ...
0
votes
0answers
12 views

Converting lighttpd rewrite rules to apache

I'm in the process of converting an application from Unix to a Windows based infrastructure, one of the changes being made is utilizing apache instead of lighttpd for the web server. Most of this ...
0
votes
0answers
16 views

LampCMS works as a sub-directory on Apache but fails on Nginx

The Web Application: It is LampCMS within a Wordpress folder. The main web site runs on Wordpress. A requirement made us create LampCMS under this Wordpress site. LampCMS is accessed over a URL ...
0
votes
1answer
23 views

How to use Nginx to both rewrite and proxy_pass whilst keeping the user-entered URL

I'm a beginner Nginx user trying to proxy the following: http://subdomain.example.com/mypage/login TO http://some_ip_address/login (not just /login - the site has other contexts too e.g. /static, ...
0
votes
2answers
953 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 ...
0
votes
1answer
15 views

Redirect document root within VirtualHost

I am trying to redirect my domain to a new document root if a cookie value is something. I did setup the rewrite and it works fine. RewriteLog "/home/vahur/dev/logs/rewrite.log" RewriteLogLevel 3 ...
3
votes
1answer
3k views

nginx $uri is url decoded

I am using nginx as reverse proxy and I have 2 rules like: location ~ ^/indirect { rewrite ^/indirect(.*) /foobar$1; } location ~ ^/foobar { set $url ...
1
vote
3answers
2k 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
0answers
16 views

404 Not Found or 500 internal server error using nginx try_files configuration

I'm trying to move my project from Apache to nginx. I use WT-NMP. I'm converting .htaccess to nginx configuration by adding this in nginx.conf. location / { try_files $uri $uri/ /index.php/$args; ...
4
votes
3answers
5k views

multiple sub_filter rules for a reverse proxy on nginx?

with no evil plans I am trying to mirror a site under other domain, while changing a few strings on the fly. I set up nginx on a new host to serve as a RP to the master site. This allows to set one ...
2
votes
3answers
2k views

lighttpd config and rewriting/disabling attempts to access favicon.ico

I've got lighttpd and apache working together on an app I'm building. lighty is serving out static content. However, each time a static asset is requested, I see a not found: favicon.ico message in ...
0
votes
0answers
31 views

Remove query string from url

We have a magento store which appends a query to our URL when you change Magento store views on the frontend. i.e. http://www.domain.com/?___store=uken Is there a way to remove the ?___store=uken ...
0
votes
0answers
14 views

Trying to disable Apache compression for an URL, but I can't get it to work

I'm trying to disable Apache compression for certain URLs by adding the lines below to .htaccess. I'm trying to get one URL working, but I can't get it to ignore the URL - Apache still renders those ...
0
votes
1answer
2k views

.htaccess Rewriting Tomcat Server

I am writing a website using Railo. My code is to be deployed on a Railo Server running on Tomcat, overlayed on a regular Apache+PHP server. I need to send all requests to ...
0
votes
0answers
9 views

Tuckey UrlRewriteFilter unable to match regex with positive lookahead

This is about Turkey's UrlRewriteFilter I have a rule to convert the first segment of url to lowercase, provided that there's an uppercase letter in it. This is what it looks like: <rule> ...
1
vote
3answers
3k 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
0answers
32 views

IIS 8 Rewrite rule gives me 404 error

I used following Rewrite rule on IIS 8 for asp.net application. But it gives me 404 error when I try to access www.mysiteurl.com/?_escaped_fragment_. If I change actionType to Redirect it redirect ...
3
votes
1answer
5k views

How to use IIS URL Rewrite with gzip compression

I've been trying to create outbound rules in IIS 7.5 on Windows 2008 R2 on a site that has static HTML pages and compression enabled. If I have any form of compression enabled (static or dynamic) I ...
1
vote
4answers
5k views

How to redirect or rewrite IIS site with port in URL to URL without port?

I'm not 100% sure if this is the right part of StackOverflow to post this but to me it made the most sense. Sorry if its not! Currently I have a site in IIS configured on HTTPS with port 7500. I can ...
0
votes
2answers
6k views

nginx rewrite rule to convert URL segments to query string parameters

I'm setting up an nginx server for the first time, and having some trouble getting the rewrite rules right for nginx. The Apache rules we used were: See if it's a real file or directory, if so, ...
0
votes
1answer
20 views

Two URLs, one website, different domains

We have a website running under abc.company.com. We've been asked to make the website available under a different url from a different domain by a customer, let's say stuff.abc.com. They've arranged ...
2
votes
1answer
79 views

What is the difference between Nginx variables $host, $http_host, and $server_name?

What is the difference between the three Nginx variables $host, $http_host, and $server_name? I have a rewrite rule where I'm not sure which one I should be using: location = /vb/showthread.php { ...
0
votes
1answer
2k views

Nginx URL virtual host rewrite issues with Magento e-commerce. Help please

I've been running into some serious problems with my URL rewrites and I can't seem to fix it on my own strength and knowledge and troubleshooting on the web! Basically what happens is that when I ...
-1
votes
0answers
19 views

Postfix Relay address rewrite based on X headers

My situation is unusual I receive emails from an unique address and need to relay them via multiple smtp mailboxes. The way the emails are differentiated is via a custom x-header. I have tried using ...
16
votes
8answers
21k views

How to inject HTML code into every delivered HTML page?

I've got an Apache web server that delivers static HTML pages. For some reason I can't change the files themselves, but I still want to inject some HTML into every page that is being served. Is this ...
0
votes
1answer
1k views

Rewrite all requests to index.php except certain subdirectory requests

I want to rewrite all requests to /index.php, except /css/* and /js/*. This is my original config location / { try_files $uri /index.php$is_args$args; } which works, but lets me access all ...
-1
votes
0answers
25 views

Apache webserver configuration/access to only index.php

I'm trying to the below with Apache/2.4.6 (CentOS) webserver installed using yum. I've got my php pages served from /var/ww/html/project1 index.php is a symbolic link that points to a login page ...
0
votes
1answer
1k views

Haproxy “use_backend” match order

I have a problem with Haproxy, it's a snippet of my haproxy.cfg below, acl url_a path_beg /a acl dom_eye hdr_dom(host) -i www.mydomin.com use_backend eye1 if dom_eye use_backend ...
1
vote
0answers
35 views

Nginx rewrite rules for all vhosts

I have a huge referer blacklist with that I want to stop referer spam on all my websites (https://perishablepress.com/blacklist/ultimate-referrer-blacklist.txt). Currently I have to change all my ...
2
votes
1answer
3k views

How to exclude a sub-folder from HTaccess RewriteRule

I have WordPress installed in my root directory, for which a RewriteRule is in place. I need to password-protect a subfolder ("blue"), so I set the htaccess in that folder as such. Problem is that ...
0
votes
0answers
21 views

rewrite nginx 2 parameters

server { listen 127.0.0.1:80; server_name ap5 www.ap5; root home/ap5/public_html; index index.php index.html; log_not_found off; access_log logs/ap5-access.log; error_log logs/error.log error; ...
0
votes
2answers
139 views

Configuring a server-wide RewriteRule in conf-available

Lately I have been getting some referrer spam in my website's logs. In order to stop this (as it's quite annoying and also polluting my statistics), I want to block requests that are coming from ...
-1
votes
1answer
30 views

NGINX Url Rewrite for PHP Variable

How would I go about making a url like: http://example.com/test123 go to a url like http://example.com/?code=test123 My server runs Nginx, and a lot of the documentation on the web is for ...
-1
votes
1answer
39 views

Two get parameters rewrite in subfolder

I have a site on domain.de/webinterface/. There is a index.php with two get parameters (page & user) Now i want that domain.de/webinterface/user/Niklas redirects to ...
0
votes
0answers
25 views

Haproxy and rewrite rules issue?

I have HAproxy listening on port 80 to send requests to a node server (port:3000) or php server (4000). The following rewrite rules should add a trailing slash to any url that is pointing to an ...
-1
votes
1answer
28 views

Apache rewrite is appending /www [duplicate]

the domain example.com points to an IP address different than www.example.com, but when people to put in the domain name I want them redirected automatically to the Web server. there is an Apache ...
9
votes
5answers
4k views

Remove “www” and redirect to “https” with nginx

I want to create a rule in nginx that does two things: Removes the "www." from the request URI Redirects to "https" if the request URI is "http" There are plenty of examples of how to do each of ...
5
votes
2answers
3k views

Prevent URL Rewrite rules from being inherited by subdirectories in IIS7

I have a URL Rewrite setup for clean URLs in a CMS and my web.config looks like this: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> ...
10
votes
3answers
17k views

nginx rewrite for an url with parameters

I have an URL of this type: http://www.example.com/?param1=val1&param2=&param3=val3&param4=val4&param5=val5 And I want to redirect it to this one: ...
0
votes
1answer
12 views

IIS Url Rewrite, Localhost Only (missing files and folders)

We work with websites that are occasionally copied into a local environment for routine debugging, etc. These sites have lots of user generated media - specifically images. To avoid downloading all ...
0
votes
0answers
13 views

Nginx alias, with query vars

0 down vote favorite I have a directory alias, with the next configuration location ^~ /sub-site { alias /usr/share/nginx/html/sub-site/public; try_files $uri $uri/ @sub-site; location ~* ...
0
votes
0answers
19 views

IIS Url Rewrite rule that handles multiple domains

I apologize in advance for being a bit of a newb with this but I'm looking for some advice. I have an upcoming site launch that will need to redirect requests from about 40 different domains to one. ...
1
vote
2answers
59 views

How do you Mask URLs in HAProxy?

Is there any way to do URL masking in HAProxy? I'd like to have a URL directing to my load balancer, i.e. www.example.com, redirect to another URL I have for another application. However, I'd like the ...
0
votes
2answers
43 views

Nginx remove everything after subdirectory

Tried searching on the forums for an answer but I'm quite stuck... I have a page called course which used to have a load of sub pages but now I need all requests for those subpages to redirect back ...
0
votes
1answer
35 views

Allow Parent .htaccess to redirect all assets

We're migrating from one subdomain to another. This particular domain has a subset of several websites. I've setup the following rewrite to handle the redirect globally: In docroot/.htaccess ("Rule ...
0
votes
0answers
21 views

ngx_http_rewrite_module does not work under https schema

Why rewrite ^/location/(.+)/?$ /destination/$1 redirect; works under under "http" schema, but it does not work under under "https" schema?
1
vote
2answers
91 views

Rewrite url with fastcgi in nginx

I have a working php fastcgi config in nginx. Now I have few requests to handle such as /X.php by /X, /Y.php by /Y Sounds simple so I wrote the following for testing: rewrite ^/X.php$ ...
1
vote
0answers
18 views

Converting .Htaccess Rewrite Rule to Nginx

I have the following apache rewrite rule which I am trying to convert to work with nginx. RewriteRule ^(.*)\/(.*)-(\d{4})(?:-(.*))?$ album.php?artist=$1&album=$2&releaseyear=$3&extra=$4 ...