Wordpress auto redirect http://example.com?lang=fa to http://example.com/?lang=fa how to stop that?

  • Are you sure WP is doing that and not your browser? Those URLs are the same, and the /? version is more correct
    – Tom J Nowell
    Commented May 14, 2019 at 20:38

1 Answer 1


This can't be done, and it isn't WordPress, it isn't even a redirect.

example.com?foo=bar isn't a real URL, so the browser corrects it to example.com/?foo=bar before it's sent out, no redirection happens

  • I can not agree with you. The WordPress ends the addresses with a slash, and when there is no trailing slash in the address, it redirects. example.com/pane_name will be redirected to example.com/page_name/, and example.com/foo?paged=2 to example.com/foo/?paged=2. In both cases a HTTP 301 header is sent.
    – nmr
    Commented May 14, 2019 at 21:34
  • Both those URLs mean the same thing though, this isn't being done for SEO purposes is it?
    – Tom J Nowell
    Commented May 14, 2019 at 21:39
  • Probably WordPress is trying to maintain linking consistency, it's possible that for SEO, but this is not my field. I meant only that it is not the browser changes address, and that redirection, however, takes place.
    – nmr
    Commented May 14, 2019 at 21:53
  • im moving from another cms to wordpress so its for seo.wordpress just redirect firstpage so this link example.com/foo?paged=2 not redirecting
    – Jerry
    Commented May 15, 2019 at 6:19
  • So that case wouldn't be affected, it's only the trailing slash on the very end that matters, e.g. /foo vs /foo/ that Google pays attention to, see seroundtable.com/google-trailing-slashes-url-24943.html
    – Tom J Nowell
    Commented May 15, 2019 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.