Questions tagged [rewrite]

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.

2112 questions
0
votes
1 answer

Nginx rewrite for a large group of URL's to a 444

I am looking for a rewrite that will pick up any number of defined URL's and do a return 444 on any of them. Rather than writing out each one individually, I was hoping for something where I could do like if location = defined file or list then…
Hogie
  • 3
  • 3
0
votes
1 answer

Nginx - proxy_pass - specific location not working

I am trying to masking a remote URL with Nginx using proxy_pass I'd like to load staging.saas.localhost/_ when the browser url is saas.localhost/uk_staging. For some reason the location in saas.localhost is not working, and for not working I mean…
Jeff
  • 5
  • 3
0
votes
2 answers

Nginx rewrite rules with php args

I have 2 websites, http://localhost/bb -- phpbb http://localhost/dp -- Drupal I wish to redirect $server_name/bb/ucp.php?mode=logout&sid=xxxxx to $server_name/dp/user/logout, the sid should be ignored. I've tried this: location /bb/ { index…
hlx98007
  • 338
  • 1
  • 4
  • 11
0
votes
1 answer

Nginx Not Passing Rewrites To PHP-FPM

I have the following rewrite rules for nginx. The rules seem to not function correctly, for example the rule for games is supposed to rewrite http://thegamesdb.net/game/2/ to http://thegamesdb.net/index.php?tab=game?id=2 hover when I navigate to…
flexage
  • 113
  • 5
0
votes
2 answers

Nginx : rewrite request for 'p.test-prd.com.local' to 'www.test.com'

For various reasons, we follow an internal DNS scheme where the internal test site for 'www.test.com' would be 'p.test-tst.com.local'. I won't go into the details why we ended up with the scheme we're using. Now, I could add 'p.test-tst.com.local',…
sbrattla
  • 1,578
  • 4
  • 28
  • 52
0
votes
1 answer

Apache Redirect for Internal Traffic Only

We have a page, gateway.school.edu, where users have to fill out a recaptcha before being directed forward to our password reset. I would like any internal traffic, any user agent on our network with a 10., 172. or 192.* IP, to get passed through…
0
votes
2 answers

blogger to pelican nginx rewrite rule

I just converted my blog from blogger to pelican. On blogger, posts used to be something like: http://blog.example.com/2014/09/title-slug.html, now my blog on pelican is http(s)://blog.exmaple.com/title-slug.html. Now that I've moved from blogger…
Maverick
  • 3
  • 2
0
votes
1 answer

Removing the prepended directories from $1 variable in a rewrite rule

I have this rewrite rule RedirectRule ^(/arf/sites/.*)$ /docs/saf/files$1 [R=301,I,L] When it redirects, $1 contains /arf/sites/filename.html so after the redirect, the visitor ends up at…
Clarkey
  • 167
  • 1
  • 4
0
votes
2 answers

Having problems with a Rewrite rule

I have an application most of it is still in development that's why i need to block access on all pages but just not two of them. Suppose i have a.php all requests will be redirected to here except b.php. So i think there should be 3 rules: 1st:…
Sinan
  • 227
  • 3
  • 6
0
votes
2 answers

nginx use rewrite as dynamic 404 image

I want to get a dynamic 404 response depending on the requested url: foo.jpg doesn't exist http://example.com/img/style/thumbnail/foo.jpg should show http://example.com/img/notfound/thumbnail.jpg with a 404 header status I got the…
jan
  • 118
  • 1
  • 3
0
votes
1 answer

How do I direct traffic without redirecting in IIS7.5?

We have a production machine running Window Server 2003. Previously, development took place in a WAMP environment but a few users are moving to IIS. The issue is, we have a directory on the server called /home/ that when visited, directs all…
Prinsig
  • 105
  • 3
0
votes
1 answer

Nignx Redirect rule to a different url based on a query

We have a wordpress installation and need to redirect lost password link to another different url for this we trying to setup a redirect rule but this is not working. Can anyone please help us. location / { proxy_pass http://localhost; …
Geo
  • 575
  • 3
  • 9
  • 23
0
votes
1 answer

why isn't this nginx rewrite working?

I'm trying to redirect wp-content/uploads/(.*)$ to images/$1 but this location doesn't appear to be redirecting - why? Would it be more efficient to use try_files? location ^/wp-content/uploads/.*$ { rewrite…
user3791372
  • 105
  • 4
0
votes
0 answers

302 redirect on all pages of website, creating crawler issues

My website is having difficulties working with Facebook/LinkedIn/social crawlers. I think this may be due to the redirect headers it seems to be returning. Browsers can access the site completely fine, but crawlers of all kinds seem to only be able…
tom
  • 101
  • 1
0
votes
1 answer

Nginx to split web traffic to a blog hosted on my domain

At the moment, I am using an Nginx frontend to cache static content for my DotNetNuke based website hosted at the hypotetical address www.mydomain.com, along with some other tasks. In this era of inbound marketing, I am thinking about hosting a blog…
Bjørn
  • 337
  • 2
  • 5
  • 11