LevelTen Interactive

Simple .htaccess Hack for Drupal SEO

Follow Me On Twitter

On a fresh install of Drupal, you'll encounter issues with how your website's domain can be accessed. Out of the box, you'll be able to access your site both with and without the "www" prefix. This can be a problem for Drupal SEO, as the potential exists for search engines to think your website contains duplicate content, even when it doesn't. This isn't a fix that will lead to dramatic improvements, but it's a good SEO best practice for Drupal sites.

Step 1: Find Your .htaccess File

This file will be located in the directory where you installed Drupal.

wheresthehtaccess.jpg

Step 2: Download to Your Desktop and Edit

Use your favorite HTML editor.

Step 3: Find the Code

Should be around line 80.

heresthecode.jpg

Step 4: Edit the Code

Uncomment (delete the # from lines 87 & 88) and adapt (change "example.com" to your domain, be sure to leave any other characters such as the "^" or "\")

thisiswhatyouchange.jpg

Step 5: Upload and Replace

And you're done! No matter how you type in your domain, it should all redirect to the "www" version.

Login or register to tag items
Your rating: None Average: 5.3 (6 votes)

How bad is it?

5.6

From my understanding duplicate with and without www isn't that much of a problem any more, right or wrong?

Mia
Me

i learned from this trick

i learned from this trick alot that was very nice of you thanks again for htaccess secret Term Paper Help | Thesis Help

cPanel you need to make sure

cPanel you need to make sure you have marked the option to show dot-files such as .htaccess.
Dissertation Help | Essay Help | Research Paper Help

Ht acess common mistake

most people do not know how to properly set up their ht access file and make the same mistakes.. be careful. oh and great post!

Very Nice

Thanks for the post, i learned from this trick alot that was very nice of you thanks again for htaccess secret

Simple but brilliant

Thanks, this is simple to do but brilliant.
When you access the File Manager i cPanel you need to make sure you have marked the option to show dot-files such as .htaccess.

simplicity

Ofentimes, simplicity = brilliance...

Added to DrupalSightings.com

Syndicate content

©1999 - 2010 LevelTen Interactive - Dallas, TX