Welcome! Log In Create A New Profile

Advanced

Add slash to the base url

Prateek Dayal
March 31, 2010 09:38AM
Hi,

I am trying to add a trailing slash to every url and I have been able to
[almost] achieve that with this rule

if ($request_method ~* get){
rewrite ^(.*[^/])$ $1/ permanent;
}

The if condition is to prevent redirection of POST requests to GET
requests. Urls such as http://localhost/anything are redirected to
http://localhost/anything/ but I am not able to redirect
http://localhost to http://localhost/

Am I missing something?

Thanks
Prateek Dayal
--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Add slash to the base url

Prateek Dayal March 31, 2010 09:38AM

Re: Add slash to the base url

Maxim Dounin March 31, 2010 09:54AM

Re: Add slash to the base url

Prateek Dayal March 31, 2010 09:58AM

Re: Add slash to the base url

Piotr Sikora March 31, 2010 11:18AM

Re: Add slash to the base url

Prateek Dayal March 31, 2010 12:22PM

Re: Add slash to the base url

Maxim Dounin March 31, 2010 12:38PM

Re: Add slash to the base url

Piotr Sikora March 31, 2010 12:46PM

Re: Add slash to the base url

Prateek Dayal April 02, 2010 11:28PM

Re: Add slash to the base url

Maxim Dounin March 31, 2010 12:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 132
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready