>>The configuration you have shown says "if the request is for /live/, >>ask the browser to instead request /live".
>>The configuration you have not shown says "if the request is for /live, >>ask the browser to instead request /live/". Thanks for the tip I think I got the problem but could not resolve it. try_files $uri $uri.html $uri/ /index.php?q=$request_uri; I even tried deleting “$uri.html $uri/” but still creating loop. I know this is a important line to display wordpress pages . now the error turn 404 from redirection loop. >>You should not have both of those in the same configuration file, or >>you get a loop. Yes I got this now as shared. Thanks for the tip again. >>The not-shown configuration is usually a very good idea if "/live" >>is to be served from the filesystem and corresponds to a directory. >>So: why do you want to remove the trailing slash, in the shown >>configuration? Actually this is a requirement from my client. >>If you want /live to redirect to /live/, then you should configure thing >>such that /live/ does not redirect to /live. No I want /live/ to be redirected to /live and the rule which is redirecting /live to /live/ and ending up as loop Is also important. Any helpful advice is highly appreciated. On Sat, Apr 30, 2016 at 1:40 PM, Francis Daly <[email protected]> wrote: > On Sat, Apr 30, 2016 at 12:47:20PM +0500, Muhammad Yousuf Khan wrote: > > Hi there, > > > I have been trying to remove the trailing slash with this redirection > rule. > > rewrite ^/(.*)/$ /$1 permanent; > > > > however it is creating a loop. > > > > curl -I https://xxxx.com/live/ > > > > HTTP/1.1 301 Moved Permanently > > Location: https://xxxx.com/live > > > curl -I https://xxxx.com/live > > > > HTTP/1.1 301 Moved Permanently > > Location: https://xxxx.com/live/ > > > Can you please guide what i am doing wrong here. > > The configuration you have shown says "if the request is for /live/, > ask the browser to instead request /live". > > The configuration you have not shown says "if the request is for /live, > ask the browser to instead request /live/". > > You should not have both of those in the same configuration file, or > you get a loop. > > The not-shown configuration is usually a very good idea if "/live" > is to be served from the filesystem and corresponds to a directory. > > So: why do you want to remove the trailing slash, in the shown > configuration? > > If you want /live to redirect to /live/, then you should configure thing > such that /live/ does not redirect to /live. > > f > -- > Francis Daly [email protected] > > _______________________________________________ > nginx mailing list > [email protected] > http://mailman.nginx.org/mailman/listinfo/nginx >
_______________________________________________ nginx mailing list [email protected] http://mailman.nginx.org/mailman/listinfo/nginx
