WordPress is adding $_GET[q] to path automatically. Don’t know why.
-
Hello, i do not understand why the wordpress moving $_GET[q] to part of url.
I try to do redirect:
1)
The ‘lookup’ is post_typepage
with slug ‘lookup’.2)
Routes:add_rewrite_rule($rule = 'lookup\/page\/([0-9]+)\/?$', 'index.php?pagename=lookup&paged=$matches[1]', 'top'); add_rewrite_rule($rule = 'lookup\/(.+[^\/])\/?$', 'index.php?pagename=lookup', 'top'); add_rewrite_rule($rule = 'lookup\/?$', 'index.php?pagename=lookup', 'top');
3)
I already didflush_rewrite_rules(false)
. Twice.4)
Current url:https://test.aga-parts.com/lookup/123/
New url:https://test.aga-parts.com/lookup/?q=123
Location:/lookup/?q=123
5)
I retrieve cycling redirect with these:
https://test.aga-parts.com/lookup/?q=123
https://test.aga-parts.com/lookup/123/?q=123
Location: /lookup/?q=123"
I do not understand why the 123 is merging to URL even if before i sent Location /lookup/
Thanks for the help.
[email protected]The page I need help with: [log in to see the link]
- The topic ‘WordPress is adding $_GET[q] to path automatically. Don’t know why.’ is closed to new replies.