<div dir="ltr"><div><br></div><div>>>The configuration you have shown says "if the request is for /live/,</div><div>>>ask the browser to instead request /live".</div><div><br></div><div>>>The configuration you have not shown says "if the request is for /live,</div><div>>>ask the browser to instead request /live/".</div><div><br></div><div>Thanks for the tip I think I got the problem but could not resolve it. </div><div>try_files $uri $uri.html $uri/ /index.php?q=$request_uri;</div><div>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. </div><div><br></div><div>>>You should not have both of those in the same configuration file, or</div><div>>>you get a loop.</div><div><br></div><div>Yes I got this now as shared. Thanks for the tip again. </div><div><br></div><div>>>The not-shown configuration is usually a very good idea if "/live"</div><div>>>is to be served from the filesystem and corresponds to a directory.</div><div><br></div><div>>>So: why do you want to remove the trailing slash, in the shown</div><div>>>configuration?</div><div>Actually this is a requirement from my client. </div><div><br></div><div>>>If you want /live to redirect to /live/, then you should configure thing</div><div>>>such that /live/ does not redirect to /live.</div><div><br></div><div>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. </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 30, 2016 at 1:40 PM, Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, Apr 30, 2016 at 12:47:20PM +0500, Muhammad Yousuf Khan wrote:<br>
<br>
Hi there,<br>
<span class=""><br>
> I have been trying to remove the trailing slash with this redirection rule.<br>
> rewrite ^/(.*)/$ /$1 permanent;<br>
><br>
> however it is creating a loop.<br>
><br>
> curl -I <a href="https://xxxx.com/live/" rel="noreferrer" target="_blank">https://xxxx.com/live/</a><br>
><br>
> HTTP/1.1 301 Moved Permanently<br>
</span>> Location: <a href="https://xxxx.com/live" rel="noreferrer" target="_blank">https://xxxx.com/live</a><br>
<span class=""><br>
> curl -I <a href="https://xxxx.com/live" rel="noreferrer" target="_blank">https://xxxx.com/live</a><br>
><br>
> HTTP/1.1 301 Moved Permanently<br>
</span><span class="">> Location: <a href="https://xxxx.com/live/" rel="noreferrer" target="_blank">https://xxxx.com/live/</a><br>
<br>
> Can you please guide what i am doing wrong here.<br>
<br>
</span>The configuration you have shown says "if the request is for /live/,<br>
ask the browser to instead request /live".<br>
<br>
The configuration you have not shown says "if the request is for /live,<br>
ask the browser to instead request /live/".<br>
<br>
You should not have both of those in the same configuration file, or<br>
you get a loop.<br>
<br>
The not-shown configuration is usually a very good idea if "/live"<br>
is to be served from the filesystem and corresponds to a directory.<br>
<br>
So: why do you want to remove the trailing slash, in the shown<br>
configuration?<br>
<br>
If you want /live to redirect to /live/, then you should configure thing<br>
such that /live/ does not redirect to /live.<br>
<span class="HOEnZb"><font color="#888888"><br>
        f<br>
--<br>
Francis Daly        <a href="mailto:francis@daoine.org">francis@daoine.org</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</font></span></blockquote></div><br></div>