Redirect all page requests to one page
I need to redirect all page requests (php, if that matters) on a specifi开发者_C百科c domain to a specific page (again, php) on that domain. I'm looking for a .htaccess, mod_rewrite solution for easy of implementation.
Try this rule:
RewriteCond $1 !=index.php
RewriteRule .+\.php$ index.php [L]
That will redirect all requests that’s URL path ends in .php
to the index.php in the same directory as the .htaccess file.
Something like this might do the trick:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
精彩评论