I have my website: http://www.testurl.com. The index.php first checks the client’s device and redirects to the mobile version and desktop version accordingly.
However, while getting redirected to the desktop version, I get the url www.testurl.com/index.shtml?redirect=false. I want to hide the ?redirect=false part using htaccess. How can I do that? Due to my logic, I can’t use post requests.
I’m assuming your index.php put it there because it needs it. You can’t simply hide it by using directives in an htaccess file.
I’m going to assume that the
redirect=falsequery string is to letindex.phpknow not to redirect again based on the user-agent. So how does rules in htaccess know whether a request has been redirected? It seems like theindex.phpneeds to be able to look at the version of the site that’s being request. If it’s a mobile user-agent, and it’s accessing the mobile version of the site, don’t redirect. If it’s a desktop user-agent and it’s accessing the desktop version of the site, don’t redirect. This way you don’t need theredirect=falsequery string.