I have recently changed my hosting provider and although my previous configuration still works to an extent - it's not perfect. I used to route all requests through a custom 404 page (written in PHP), and set the headers accordingly. My new host still understands all this, but only ever sends a 404 header, even when i try to send a 200 OK or 301. To solve the problems I want to re-write the request url from something like this http://my-domain.com/here-are/some-variables/ to http://my-domain.com/?here-are/some-variables/ [Note the addition of the "?" after the domain name] I have tried RewriteEngine On RewriteRule (.*)/ /?$1 and RewriteEngine On RewriteRule (.*)/ /index.php?$1 neither of which worked (500 errors all over the place) A nudge in the right direction would really help.... Thanks in advance for any suggestions or solutions.......
I've been given this snippet for translating http://domain.com/this/that/ to http://domain.com/?this/that/ RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC] RewriteRule ^/(.*)$ /?$1 [L] Code (markup): I've yet to test it, but will post my findings here when i get the chance
the rule you are using is generating an infinite loop. try using the negation character (^) something similar to this : RewriteRule ^[^\?](.+)$ /?$1 [L] may not work however, I got this from the top of my mind