Return to Snippet

Revision: 43490
at March 25, 2011 02:00 by nikefido

Initial Code
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !\.(js|css|gif|jpg|jpeg|png|ico|swf|pdf)$
RewriteCond %{REQUEST_URI} !=/
RewriteRule ^(.*)$ / [L,R=301]

Initial URL

Initial Description
Redirects all requests to the index page, unless the file is an asset (css, javascript, image, etc). All directories (real or fake) get redirected to the index page. Note the file extensions (js|css|gif|jpg|jpeg|png|ico|swf|pdf) can be added and subtracted too, depending on your needs.

Initial Title
htaccess redirect all pages to index page

Initial Tags

Initial Language