I'm using Apache 2.2 and PHP 5.3.8. How should I configure .htaccess to redirect every request do index.php?
I'd like to have URLs like those of stackoverflow or facebook, as: http://mywebsite.com/fancypage where fancypage isn't a directory on the server but just a parameter.
So I thought I needed to redirect every request to a php page, where some code can interpret the $_SERVER['REQUEST_URI'] string. Is this the right way? will $_SERVER['REQUEST_URI'] still be available after the redirection?
Try adding the following to the .htaccess file in the root directory of your site.
It will send all requests (except for existing files/dirs) to index.php.
The original request will be available in the
request
param.