-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redirect loop on Nginx, MySQL, PHP (LEMP) Stack on Debian 7 #110
Comments
REQUEST_URI does include query on all tests servers I tried. Are you sure it is not included on your server? Which version of -X do you use? Can you try the latest from the GitHub, which can be downloaded from page https://github.com/qTranslate-Team/qtranslate-x with "Download ZIP" button: https://github.com/qTranslate-Team/qtranslate-x/archive/master.zip? Please, paste here |
Hi @johnclause, I believe you miss understood me. let's assume I'm accessing http://example.com/my-page/?something and my default language is portuguese (/pt): The following line will result in $url_orig = http://example.com/my-page/?something $url_orig = $url_info['scheme'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; after that there is this line: $url_lang = qtranxf_convertURL('',$lang) which I believe is not outputing http://example.com/my-page/?something but either: http://example.com/pt/?q=my-page/?something and on the second hop, as it will not match, it will append another "q=" and so on... one of the reasons is because of the whole QTX_URL_QUERY thing, that maybe is incompatible with nginx way of getting permalink to work. |
Hi, you explained the same thing over, but no new information. I need to see $_SERVER variables as they defined on your server. I also have no idea where 'q=' comes from. |
this is from "info.php"
|
There is no query string on this one?
|
I'm sorry, here is a new one:
|
I'm not sure if this applies, but nginx vhost have the following configured:
|
That shows no surprises on REQUEST_URI:
which invalidates your previous explanation.
Aha, this is where 'q=' come from, then fix it 👍 |
I was unsure if that line was really needed. I got solved by changing it to:
the culprit was that missleading tutorial from digitalocean that my client followed: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-12-04 I'm filling the missing parts here to help anyone having the same issue. Thank you very much for your time, Cheers |
I am glad, Gabriel, that it was that simple. Can you change the title of this thread, so that people can see that they can get help with this kind of installation? Best regards. |
I thought that you may not have the ability to change title, and decided to change it myself. Now I know you can. Thanks a lot. |
My client have a wordpress install on a machine bootstrapped following this tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-debian-7
Your plugin works fine redirecting pages from /my-page to /pt/my-page, but if there is a query string (for example google analytics source tracking, or anything else), than it fails to redirect to a valid url:
accessing : http://example.com/pt/my-page/?something
redirects to: http://example.com/pt/my-page/?q=/my-page/?&something
which redirects again to: http://example.com/pt/my-page/?q=/my-page/&q=/my-page/?&something
and so on...
I believe the problem is in this line:
https://github.com/qTranslate-Team/qtranslate-x/blob/master/qtranslate_core.php#L75
REQUEST_URI does include the query_string, which will never make the comparison for the canonical url match, and will trigger redirection infinitely.
The text was updated successfully, but these errors were encountered: