Missing slash on URL?

Jeffrey 'jf' Lim jfs.world at gmail.com
Sun May 25 17:46:23 MSD 2008


On Sun, May 25, 2008 at 3:43 AM, Floren Munteanu <nginx at yqed.com> wrote:

>  There is something wrong, when I try to access this location, for
> example:
>
> http://localhost/forum
>
>
>
> Normally, if I access the above URL, it will automatically add at the end a
> slash:
>
> http://localhost/forum/
>
>
>
> The page displays OK. How would I automatically add a / at the end of each
> URL, only if it misses and an actual file is not called from URL? For
> example:
>
> http://localhost/forum will turn into http://localhost/forum/ while
> http://localhost/forum/test.php remains unchanged.
>
>
>

if (-f $request_filename/index.html) {
                rewrite (.*) $1/index.html break;
}

put that in appropriately, and add an "or" if you want to for index.php as
well...

-jf

--
In the meantime, here is your PSA:
"It's so hard to write a graphics driver that open-sourcing it would not
help."
-- Andrew Fear, Software Product Manager, NVIDIA Corporation
http://kerneltrap.org/node/7228
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080525/10dbbebb/attachment.html>


More information about the nginx mailing list