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

mat h mat999 at gmail.com
Fri Sep 10 05:46:41 MSD 2010


something like:
rewrite (.*)/index.html $1;

should do it.

On Fri, Sep 10, 2010 at 8:22 AM, ez77 <nginx-forum at nginx.us> wrote:
> Greetings,
>
> I'm trying to send all .../dir/index.html requests to .../dir/ . I
> looked this up in forums but I'm only able to do it for the root
> directory:
>
> [code]
> location / {
>    root   /var/www/mysite;
>    index  index.html index.htm;
>    if ($request_uri = /index.html) {
>    rewrite ^ http://$host? permanent;
>    }
> }
> [/code]
>
> Some day I'll try to stop this copy-and-paste madness, but "in the
> meantime"... could someone please give me a hand? I would greatly
> appreciate it.
>
> Thanks and cheers,
>
> Ezequiel
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,128951,128951#msg-128951
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



More information about the nginx mailing list