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

ez77 nginx-forum at
Fri Sep 10 02:22:23 MSD 2010


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

location / { 
    root   /var/www/mysite;
    index  index.html index.htm;
    if ($request_uri = /index.html) {
    rewrite ^ http://$host? permanent;

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,


Posted at Nginx Forum:,128951,128951#msg-128951

More information about the nginx mailing list