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
0
votes
0 answers
Nginx redirecting site index requests
Existing functionality: try_files along with rewrite are being used to allow requests for foo.html and foo/ to redirect to foo.
Problem: If I specify try_files $uri.html $uri @noextension =404;, then a request to domain.com/ redirects to a 404 page…

Astron
- 377
- 4
- 16
0
votes
1 answer
Nginx rewriting files that do not exist
Nginx is returning the site root index instead of a 404 response for non-existent files, i.e. attempting to rewrite files that do not exist which is undesired. While I see the topic was answered here, I do not see how it applies to my configuration…

Astron
- 377
- 4
- 16
0
votes
1 answer
Nginx: How do I point the root to a Ghost blog located in a subdirectory?
I have installed Ghost inside a blog/ directory in my site's root. The site works as domain.com/blog/ and serves static files from public_html/ directory (including index.html). I would like to have the index point to domain.com/blog/ without…

Web Guy Ian
- 101
- 1
0
votes
0 answers
Nginx Rewriting, Renaming and Redirecting to another Folder
I am trying the following steps to my old urls before redirecting them:
1) Rewrite all urls inside a folder by replacing underscores to hyphens
2) Remove the old folder name
3) Try the new urls in multiple url locations to see whichever exists
I've…

Neel
- 1,441
- 7
- 21
- 35
0
votes
1 answer
How to create Multiple Parked Domains in Nginx Server Block
I have bought multiple domain names for my website. Right now, I redirect these parked domains (the domains pointing to my nginx ipaddress) like this:
server {
server_name example.com www.example;
rewrite ^(.*) http://example.co.uk$1…

Neel
- 1,441
- 7
- 21
- 35
0
votes
1 answer
Nginx Re-write: Different URL based on incoming URL format
I have a server that will have 2 different types/formats of requests coming in. Both request URL's will start with: http://myredirect.mycompany.com/browse/. After '/browse/' it will either be a number:
http://myredirect.mycompany.com/browse/12345,…

darksideofthesun
- 145
- 5
0
votes
1 answer
mod_rewrite combine these two rules into one
I have two rules that currently function as they should, but I feel like they can be consolidated into one for the benefit of a smaller config to maintain and less rules to process for each HTTP request. The rules:
RewriteRule ^/user/[0-9]+/?$…

imaginative
- 1,971
- 10
- 32
- 48
0
votes
1 answer
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
But I want to clean this up by being able to access…

dcolumbus
- 475
- 1
- 5
- 10
0
votes
2 answers
Nginx: How to rewrite arguments passed to index.php?
I am struggling with some Nginx rewrits for url arguments passed to index.php:
Old: ?topic=10126.msg36887
New: ?posts/36887/
My two questions:
1) How do I rewrite to the new argument structure since it uses "parameter/value/" rather than the…

Jeff Widman
- 2,465
- 4
- 24
- 20
0
votes
1 answer
apache rewrite rules, non-www, https
I have two applications on the same server and use apache rewrite rules to redirect:
www requests to non www
http reuests to https
Everything works ok, except one case:
request www.test2.test.eu is redirect to https://www.test1.com content
How can…

gaspar
- 133
- 1
- 10
0
votes
1 answer
How to restrict proxied apps based on application auth logic
I have a vhost with mod proxy that redirects fine, but I’d like to add to it.
Here’s my vhost:
ServerName www.domaine.local
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /subsonic/…

sonicpm
- 1
0
votes
2 answers
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 certain referrer domains. A lot of articles can be…

Nic Wortel
- 103
- 4
0
votes
1 answer
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: /donor.php?yyyy=2014&mm=12&dd=07&donor=Name.
My current setup is…

Sergey Kozlov
- 101
- 1
0
votes
1 answer
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 emails are forwarded from google apps to…
user257084
0
votes
1 answer
nginx rewrite specific .css url to specific .php url
I'm assuming this is an easy one for anyone with nginx knowledge.
I'm calling a URL like this:
/site-preview/css/custom-styles.css?org=myorg
The file custom-styles.css doesn't actually exist. So, I want to rewrite the URL to actually serve…

tptcat
- 247
- 1
- 2
- 7