Why hacking $_SERVER['REQUEST_URI']?
-
Hi!
A lot of Polylang users report a conflict with Nextgen Gallery. When trying to access their gallery, they are redirected to the album page.
If I try to access
/albums/nggallery/my_album/my_gallery
I am redirected to/albums
Spending some hours to debug this, I concluded that Polylang is making a redirection based on a wrong information.
Polylang has a canonical redirection mechanism. But It receives
//albums
in$_SERVER['REQUEST_URI']
(wrong as I am expecting/albums/nggallery/my_album/my_gallery
and worse, malformed due to the two slashes).
Thus passing this value to the WordPress core function redirect_canonical, it logically returns/albums
, different from the requested url known by Polylang, which thus fires the redirection to the wrong url.
- The topic ‘Why hacking $_SERVER['REQUEST_URI']?’ is closed to new replies.