Welcome! Log In Create A New Profile

Advanced

Re: Beginner's question: redirecting /dir/index.html to /dir/

mat h
September 11, 2010 09:48PM
rewrite ^(.*/)index.html http://$host$1 permanent;

On Sun, Sep 12, 2010 at 11:39 AM, ez77 <nginx-forum@nginx.us> wrote:
>> At the risk of pushing it... is there a way to make the redirect 301
> rather than 302?
>
> In case anybody is interested, the following code (very similar to the
> original I found elsewhere) works OK in the latest version, 0.8.50, with
> a 301 response:
>
>      location / {
>            root   /var/www/mysite;
>            index  index.html index.htm;
>            if ($request_uri ~ (.*/)index.html) {
>            set $files $1;
>            rewrite ^ http://$host$files permanent;
>            }
>        }
>
>
> By now I don't even know if I tried this exactly with an older
> version... certainly something like this, but it didn't work.
>
> Cheers!
>
> Ezequiel
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,128951,129630#msg-129630
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

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

Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 09, 2010 06:22PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

mat h September 09, 2010 09:52PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

Igor Sysoev September 10, 2010 12:02AM

Re: Beginner's question: redirecting /dir/index.html to /dir/

Igor Sysoev September 10, 2010 12:14AM

Re: Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 10, 2010 12:51PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

Igor Sysoev September 10, 2010 03:58PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 11, 2010 05:25PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 11, 2010 09:39PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

mat h September 11, 2010 09:48PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 12, 2010 12:13PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

Igor Sysoev September 12, 2010 02:14PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

Splitice September 13, 2010 01:52AM

Re: Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 13, 2010 03:07AM

Re: Beginner's question: redirecting /dir/index.html to /dir/

mat h September 13, 2010 03:26AM

Re: Beginner's question: redirecting /dir/index.html to /dir/

Igor Sysoev September 13, 2010 04:26AM

Re: Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 13, 2010 01:39PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

Eugaia September 13, 2010 01:44PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

Igor Sysoev September 13, 2010 02:52PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 13, 2010 06:51PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 13, 2010 06:59PM

Re: Beginner's question: redirecting /dir/index.html to /dir/

ez77 September 13, 2010 07:27PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 314
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