New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Nginx rewrite issue.
I'm having an issue setting up nginx rewriting for my site.
location /download {
rewrite ^ /download.php;
}
This works fine, but the issue is if I browse to http://mywebsite.com/downloads, it also redirects to download.php. Same goes for any letters typed after download, e.g http://mywebsite.com/downloadasdf also redirects to download.php.
Anyone any idea how to sort this? Thanks!
Comments
I just clicked your link to see your website I failed
I'd suggest:
Works perfectly (when I take the / off the end of /download/)!
Thanks so much!
Ah, haven't noticed the final /
Glad it works
will you mean this?
location = /download {
rewrite ^ /download.php;
}