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 is a well-known Australian SEO and a managing director of Dejan SEO. He has published numerous research articles in the field of search engine optimisation and online marketing. Dan's work is highly regarded by the world-wide SEO community and featured on some of the most reputable websites in the industry. Questions? Here's Dan's contact email.

More Posts - Website

Copy the code below to your web site.
x 
 

© 2014 DEJAN SEO. All Rights Reserved. Privacy Policy by TRUSTe - Link to us
DEJAN SEO PTY LTD - ABN 77 151 340 420 - ACN 151 340 420
National Sales Number: 1300 123 736 - International Callers: +61 7 3188 9200

Privacy Policy by TRUSTe Google Partner