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
4answers
7k 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", ...
1
vote
2answers
23 views

Trying to rewrite /directory/dir_variable/ to /directory/dir_variable/index.php

I'm trying to rewrite something like this: domain.tld/staging/base_1/ to domain.tld/staging/base_1/index.php where '1' is a variable number. but am getting a redirect cycle. *1 rewrite or ...
0
votes
2answers
144 views

nginx Subdirectory Rewrites for MVC

I am tasked with administering a web application that has a base directory with a bunch of legacy code in it, and a subdirectory of my own making with an MVC based API which we are using to slowly ...
0
votes
0answers
31 views

Apache URL Rewrite On the same Virtual Host works in one case but fails in another

I have an odd problem, where I am rewriting a URL to proxy to two different URL destinations, based on digits that are passed in the URL and a particular string, in the same virtualhost definition, ...
0
votes
0answers
45 views

Squid: bypass url_rewrite_program when request is https

I have a url rewriter working in squid currently. The problem is that, while it works fine for HTTP, HTTPS requests obviously don't work, even when rewritten with the same URL (because my server would ...
3
votes
2answers
10k views

How to enable the rewrite feature in nginx 1.0.5?

I recently installed nginx 1.0.5 with php fpm, php apc and postgres. I just want to play around with nginx and learn how to configure the basic stuff. For extended testing I decided to install PHPBB3 ...
0
votes
1answer
53 views

nginx: regex not working on url rewrite

I have http://sample.cervo02.com. i'm trying to get https://cervo02.com/sample. I tried couple of redirect none of them are working. rewrite ^([^.]*)$ https://cervo02.com/$1 last; return ...
1
vote
1answer
18 views

Postfix deliver mail for orginal destination + BCC - but only for one email

I have postfix with virtual users, I'm looking for solution, tried google it, but no luck. I want to achieve this one: mail for admin@* should be delvered to admin@* and BCC for webmaster@* I ...
0
votes
1answer
71 views

Postfix reply to emails addressed to external email while keeping the correct from address

I have a mail server all set up and running on ubuntu 14.04 with Postfix / Dovecot for the domain "postfixserver.com". A second domain "googleapps.com" is running on google apps. user@googleapps.com ...
0
votes
1answer
30 views

How To …IIS, Reverse Proxy, URL Masking, Outbound .?

Here is the background On our website there is a a search function which communicates with Google Search Appliance (GSA). When the user lick on search it sends the request to ...
0
votes
1answer
75 views

web.config URL access and rewrite

I'm trying to clean up some URLs to a bunch of PDF files. Right now, you access a PDF by visiting the following: http://www.mywebsite.com/sites/default/files/reports/2010_Audit_Summary_Report.pdf ...
1
vote
1answer
141 views

Set Access-Control-Allow-Origin Header for specific URL that has a Query String

I'm asking this here as a last resort after trying different things / asking google / reading http://httpd.apache.org/docs/2.2/ I have the following in my apache2.conf # Allow cross domain fonts ...
2
votes
1answer
139 views

nginx location and root settings dont work

I am trying to rewrite every file after cdn.minora.me/forum/ to another directory: server { listen 443 ssl; listen [::]:443 ssl; ssl on; ssl_certificate ...
0
votes
1answer
60 views

nginx location regex /yyyy/mm/dd/

I'm trying to pass requests from address example.com/donor/2014/12/07/Name on the other server. URIs are like /donor/2014/12/07/Mike and I need to convert them to a query type of: ...
0
votes
0answers
81 views

ARR and URL rewrite for node express website for iis server

I have an express.js website running on my localhost in my Webserver (IIS8.5). When I use ARR and url rewrite to point to localhost port 3000 where my express website is, I can access part of it from ...
0
votes
0answers
36 views

Nginx rewrites & passing PHP request to Apache efficiently

I'm in the process of moving my rewrites off Apache and including them in Nginx instead. The code below appears to be working fine, but is this the most efficient way of doing it? Also, what if I ...
0
votes
1answer
188 views

Rewrite/configure WebSVN location with MultiViews

I have configured mod_dav_svn 1.8.9 on FreeBSD along with WebSVN 2.3.3 this way: <Location /repos/svn> DAV svn SVNParentPath /usr/local/svn/repos SVNListParentPath On ...
1
vote
1answer
710 views

IIS URL Rewrite - Redirect any HTTPS traffic to sub-domain

Our hosting environment dictates all secure traffic music travel over a particular sub-domain. We are using the .NET CMS Umbraco, which as far as I'm aware doesn't have any functionality to 'assign' ...
3
votes
1answer
865 views

How to exclude IP from htaccess domain redirect [duplicate]

I'm trying to write a custom redirect rule for some testing purposes on 2 domains with exactly same site. The code I am using is: RewriteEngine on RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$ ...
0
votes
0answers
13 views

server farm configuration for redirect and reroute [duplicate]

I have a windows server 2012 at home and I want to redirect specific requests to different machines in my network. How can I configure, for example, all requests for www.sample01.com to go to ...
0
votes
2answers
25 views

Nginx rewrite rule for CDN

I am struggling with converting an Apache rewrite rule to Nginx. The rule lives inside WEBROOT/cdn/.htacces and reads: RewriteRule ^[0-9]{1,6}/(.*)$ ../$1 [PT] The goal of it is to take a URL like: ...
0
votes
1answer
14 views

Rewrite rule for custom parameter

I need to write a rewrite rule that will do the following: When user enters mysite.com/whatever, this address will stay in the browser but in the background following address will be called: ...
0
votes
1answer
25 views

Nginx rewrite *.domain.tld/page to domain.tld/page

I can not set up a redirect from *.domain.tld/personal to domain.tld/personal server { server_name domain.tld www.domain.tld *.domain.tld; listen 100.10.10.1; set $root_path ...
1
vote
0answers
111 views

Is websocket reverse proxy possible with IIS 8.5 & URL rewrite 2.0?

I installed Tomcat as a java app server behind IIS. Using the following rules I can rewrite static pages just fine, but alas, websocket connections are never established: <?xml version="1.0" ...
-1
votes
1answer
30 views

How to make a RewriteRule on Apache .htaccess to fix a broken image? [duplicate]

My page has: <img src="/?cp_contactformtoemail_captcha=captcha&a=1&b=2&c=image.jpg" id="captchaimg_1" alt="security code" border="0"> But it should be: <img ...
2
votes
8answers
10k views

Excluding a directory from a root .htaccess rewrite rule to allow it to be password protected?

I have spent a tremendous amount of time the last week trying to figure this out, but no matter what I try I cannot get this to work. My web host said they did not have anyone who knew enough about ...
0
votes
0answers
21 views

Rewrite URL to so subfolder points to root in IIS

I have a website which when publish has a URL like: sub.website(dotcom)/sub/Default.aspx Is it possible to change it see when the user navigates to sub.website(dotcom)/ it loads the ...
0
votes
0answers
60 views

How to debug opencart redirect loop?

I'm attempting to redirect an opencart website from http://domain.com to https://domain.com, i have tried the following with different variations: RewriteCond %{SERVER_PORT} !^443$ or RewriteCond ...
-1
votes
2answers
436 views

URL Shortener & Site Redirection on same domain

i have one domain(http://sdm.fm), And I would like it to work as a redirect to http://somdomato.com. But at the same time I would like it to work as a URL shortener. Using phURL. Like: ...
2
votes
0answers
40 views

Apache rewrite works under FreeBSD, not under CentOS

I have 5 production servers which are running FreeBSD 9.2, but we are planning on transitioning to CentOS. Because of this, I am attempting to set up some virtual machines to emulate our production ...
0
votes
1answer
3k views

IIS 7 Url Rewrite Not Working

Inbound IIS7 Url Rewrite Rule not working Below is the URL Rewrite rule I've defined. <rewrite> <rules> <rule name="Redirect domain.co.uk to www.domain.co.uk" ...
0
votes
0answers
47 views

Nginx redirect or rewrite with folder

I have a virtual machine with an apache which serves a web application at https://my.ip.address/web/index.hml (internal). At the router/firewall is a nginx running which works as an reverse proxy with ...
0
votes
0answers
75 views

Exceptions in redirection in URL in IIS Rewrite module are ignored

I have a new site https://www.NewSite.com and I would like all the traffic to my old site https://www.OldSite.com to be redirected to the root of my new site https://www.NewSite.com/, with some ...
0
votes
0answers
29 views

IIS Setup Redirect traffic from webserver to app server

I have done quite a few setup which involved hosting applications in IIS and configuring them accordingly, but now I have a different situation ... I have 2 web servers which don't host any ...
1
vote
1answer
454 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 ...
1
vote
1answer
131 views

NginX rewrites and absolute resource paths

On my domain, I have a subdomain for Meteor applications, say http://meteor.example.com/ Under this, I would like to put individual applicaions, with an URI for each. Say the meteor application ...
2
votes
1answer
72 views

Nginx redirect to port specified in URL

Is it possible to use Nginx to proxy from a URL like this: http://example.com/service/1234/foo.php?... to an internal service like this: http://example.com:1234/foo.php?... That is, extract a ...
0
votes
0answers
75 views

nginx catchall reurns bad gate way with $host in proxy_pass

I am currently using the following virtual server proxy setup on my development environment the defined virtual servers work fine but i am coming up with a bad gateway error when i hit my catchall ...
-1
votes
2answers
64 views

Nginx rewrite with Server_name as underscore

We have nginx config with server_name as underscore. How do I rewrite from http to https. server { server_name _; rewrite ^/(.*) https://$server_name/$1 permanent; } This returns error as http://_/ ...
0
votes
1answer
33 views

Ngnix rewrite with catchall server_name

Im trying to do a rewrite based on a catchall server name. So I would like any domain that hits this server for example demo.example.com to be rewrote to example.org?site=demo.example.com ...
-1
votes
1answer
646 views

Nginx rewriting based on request method and get variables

I want to rewrite /wp-login.php?action=register to /register, but only if it's a GET request. Here's what I have so far, while it doesn't error it just doesn't do anything.. location /wp-login.php { ...
2
votes
6answers
14k views

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 ...
1
vote
0answers
33 views

IIS URL Rewrite to act as 404 handler

How can I use the URL Rewrite module in IIS to mimic a generic 404 handler? It is easy enough to set up rewrite rules that match a specific pattern, but what I want to do is to set up a rewrite rule ...
0
votes
1answer
38 views

What is the nginx version of these .htaccess rules? [closed]

How should I rewrite this htaccess rules to nginx kind of rules: RewriteCond %{REQUEST_URI} !^/?puppy/index.php$ RewriteRule . /puppy/index.php
0
votes
1answer
1k views

How to explicitly apply percent escapes to a URL in nginx?

I have the following configuration: location ~ ^/((index\.php|robots\.txt|admin|static|uploads|api)(/.*)?)$ { proxy_set_header Host $http_host; proxy_pass http://localhost:1337/$1?$args; } ...
0
votes
3answers
143 views

Rewrite in Nginx Does not work for POST request

I have two VPS(one is for fail over), both running Nginx as a Load balancer for backend servers. Also, I have Enabled and configured SSL for my domain(registered on GoDaddy.com) on Nginx. Since I am ...
0
votes
1answer
66 views

URL-Rewrite to One site But not the Other

We have our own domain and have several subdomains. One of the sites needs to be accessed only via SSL, but people are allowed to type http and still arrive there. The URL-Rewrite forces the http ...
0
votes
2answers
2k views

Why doesn't this IIS Rewrite work for Firefox and Chrome?

In my IIS7.5 on my Windows 2008R2 server, I have a url rewrite. The rewrite seems to work in Internet Explorer, but Firefox and Chrome still give me a 404. Firefox even skips the redirect if refresh ...
0
votes
2answers
342 views

Redirect traffic based on url to different ip address maintaining port and url information [duplicate]

We have a QA version, a UAT version, and a DEV version of webapp. Users need to access these via http://uat.company.com:41002/webapp, http://qa.company.com:41002/webapp, and ...
0
votes
0answers
123 views

Nginx: Redirect subdomain to path

This is very similar to the question at http://stackoverflow.com/questions/14491944/nginx-convert-subdomain-to-path-component-without-redirect, however I need it to be a permanent redirect (not ...