/ Published in: PHP
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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !\.(js|css|gif|jpg|jpeg|png|ico|swf|pdf)$ RewriteCond %{REQUEST_URI} !=/ RewriteRule ^(.*)$ / [L,R=301]