Welcome! Log In Create A New Profile

Advanced

Re: Redirection problem again in new rules.

Francis Daly
April 15, 2016 12:38PM
On Fri, Apr 15, 2016 at 12:27:11PM +0500, Muhammad Yousuf Khan wrote:

Hi there,

> Sorry for the mistake in a's and b's i was typing that in general because
> the context was not the URL but the problem.

If you can show one specific url which does show the problem, then it
makes it much easier to see what is going on.

If you can also include one small but complete config file that shows
the problem, that makes it much easier for someone else to repeat your
experiment.

(And sometimes, the act of making a small config that shows the problem,
will show you what the fix is.)

> >Do note that "location /x" can match anything that starts with /x; and
> >if a request for /x.html returns a redirect to /x.html, you've got a loop.
>
> Yes , i have double checked but my redirection rules are not created wrong.
> so i am sure no loop is happening there.

Part of the point of you asking the question, is that you do not know
where the problem is.

So usually, the best thing is to run a test nginx with your config, then
remove as much as possible while still showing the problem. Maybe that
config will just have two location{} blocks, and the loop will be obvious.

> BTW just to update you guys. i am using wordpress.
>
> i am doing two redirections , one domain base and second URL base.
>
> domain base is working fine however URL redirections are giving me issues.

Use "curl" to test your broken url and see what exactly is returned.

Do something like

curl -i http://your-server/aaaa/bbbbbbbb

and you should get a http 301 response, with something in the Location:
header.

Then do "curl -i" against that url, and see if you get the loop.

The *rest* of the headers may show that PHP was, or was not, involved
in the redirections.

> could this be related to wordpress?

It could be.

If the "curl" responses show that PHP is involved, then it probably is.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Redirection problem again in new rules.

Muhammad Yousuf Khan April 14, 2016 10:04AM

Re: Redirection problem again in new rules.

ph.gras April 14, 2016 11:20AM

Re: Redirection problem again in new rules.

Francis Daly April 14, 2016 01:06PM

Re: Redirection problem again in new rules.

Muhammad Yousuf Khan April 15, 2016 03:28AM

Re: Redirection problem again in new rules.

Francis Daly April 15, 2016 12:38PM

Re: Redirection problem again in new rules.

Muhammad Yousuf Khan April 16, 2016 03:24AM

Re: Redirection problem again in new rules.

Francis Daly April 16, 2016 08:38AM

Re: Redirection problem again in new rules.

Muhammad Yousuf Khan April 18, 2016 09:40AM

Re: Redirection problem again in new rules.

Francis Daly April 18, 2016 07:24PM

Re: Redirection problem again in new rules.

Muhammad Yousuf Khan April 20, 2016 06:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 178
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready