I have issue with a strange url request to my site.. that may come from bot or other website ..
i have researched all my code and link on web.. but not find and link like that
the url they request not in correct order is:
/modules.php?file=article&name=News&sid=281737
but the correct one should be
/modules.php?name=News&file=article&sid=281737
in fact the php can handle both of those … but i using static caching system , which makes two files on cache. Making lots of files is not good for web performance.
I need a php script that use $_SERVER[‘REQUEST_URI’] and regex to detect the wrong url
then send it to correct url with 301 header
Thanks for any advice.
Do it at the web server level. Since you tagged your question
.htaccessI’m assuming that’s Apache.I haven’t tested that, does it work?