Welcome! Log In Create A New Profile

Advanced

Re: Trailing Slash Redirect Loop Help

Francis Daly
April 29, 2017 08:36AM
On Fri, Apr 28, 2017 at 10:27:12AM -0400, Alex Med wrote:

Hi there,

> I am having an issue getting rid of the trailing slashes for directories. I
> have used the following to get rid off the trailing slash:

Why do you want to get rid of the trailing slash for directories?

You can do it; but you will probably have to write the code to tell your
web server how to handle the request, because the common case is that
the slash is wanted.

So - you can make a request for /file/; nginx can issue a redirect to
/file; you can make a request for /file; and nginx can serve the content
of /usr/local/nginx/html/file. All good.

Next - you make a request for /dir/; nginx can issue a redirect to /dir;
you can make a request for /dir; what do you want to happen next? The
nginx-is-serving-this-from-the-filesystem behaviour is for nginx to issue
a redirect to /dir/. If you want something else to happen, you must
decide what that something else is, and then arrange that it happens,
possibly by config and possibly by coding.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Trailing Slash Redirect Loop Help

Alex Med April 28, 2017 10:27AM

Re: Trailing Slash Redirect Loop Help

steveh April 28, 2017 10:42AM

Re: Trailing Slash Redirect Loop Help

Alex Med April 28, 2017 10:48AM

Re: Trailing Slash Redirect Loop Help

steveh April 28, 2017 11:36AM

Re: Trailing Slash Redirect Loop Help

Alex Med April 28, 2017 11:43AM

Re: Trailing Slash Redirect Loop Help

steveh April 28, 2017 11:48AM

Re: Trailing Slash Redirect Loop Help

Alex Med April 28, 2017 12:52PM

Re: Trailing Slash Redirect Loop Help

steveh May 01, 2017 06:42PM

Re: Trailing Slash Redirect Loop Help

Alex Med May 10, 2017 10:43AM

Re: Trailing Slash Redirect Loop Help

Francis Daly April 29, 2017 08:36AM

Re: Trailing Slash Redirect Loop Help

Alex Med May 10, 2017 11:10AM

Re: Trailing Slash Redirect Loop Help

Francis Daly May 12, 2017 05:26PM

Re: Trailing Slash Redirect Loop Help

Alex Med October 06, 2019 12:24PM

Re: Trailing Slash Redirect Loop Help

Francis Daly October 08, 2019 06:48PM

Re: Trailing Slash Redirect Loop Help

Alex Med October 09, 2019 11:22AM

Re: Trailing Slash Redirect Loop Help

Francis Daly October 09, 2019 05:34PM

Re: Trailing Slash Redirect Loop Help

Alex Med October 14, 2019 11:04PM

Re: Trailing Slash Redirect Loop Help

Alex Med October 14, 2019 11:06PM

Re: Trailing Slash Redirect Loop Help

Francis Daly October 15, 2019 10:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 117
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready