Handy .htaccess Snippets

Wildcard 301 redirect to new domain’s index page

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.domain.com/ [R=301,L]

Wildcard 301 redirect to home page (with exclusion example)

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !.css$
RewriteRule ^(.+)$ / [R=301,L]

Dan Petrovic, the managing director of DEJAN, is Australia’s best-known name in the field of search engine optimisation. Dan is a web author, innovator and a highly regarded search industry event speaker.

More Posts - Website