It's a longshot, but I'm hoping to find a simple workaround for a bizarre bug that only manifests when the query string is omitted/inferred by the application.
Before I dig deep into a thousand lines of minified 3rd party javascript, I'd like to find out if I can just auto apply the querystring using mod_rewrite.
RewriteRule ^index\.php$ index.php?module=Home&action=index
Now, this would work fine except sometimes all the data will be POSTed so I need a RewriteCond
so the rule will only fire on GET
requests, and not POST
requests.
Is this possible?
I'd recommend being explicit and only firing the RewriteRule when the request method is GET, rather than whenever it's not POST as there are numerous other methods. So your rewrite condition could look like this:
RewriteCond %{REQUEST_METHOD} =GET
RewriteRule ^index\.php$ index.php?module=Home&action=index
Add this condition...
RewriteCond %{REQUEST_METHOD} !POST
...to not match POST
requests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With