Sunday, November 16, 2008

301 Redirect For URLs With Spaces


A few post back I talked about proper URL structure with your BANS stores. If you do a site:yourdomain.com in Google, the bad URLS will stick out like a sore thumb because they will have %20 in the URL where a space normally is. If you go into edit the URL to take out the space and enter in a hyphen, undesrcore or anything without a space, you will have to do a 301 redirect in your .htaccess file so the SERPS now the page has moved.

Lets say the bad url looked like this below:

www.yourdomainname.com/Bad%20Link%20Structure

and you corrected your URL in BANS admin to the below:

www.yourdomainname.com/bad-link-structure

the line in the .htaccess file would look like below:

RewriteRule ^Bad\ Link\ Structure(.*) http://www.yourdomainname.com/bad-link-structure$1 [R=301,L]

Using the backslash escapes the space. Your old bad URL should redirect to the new URL in your browser.

Related Posts by Categories



0 comments:

Followers

Twitter Updates

    follow me on Twitter
     

    Build A Niche Store Blog. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted by Bloganol dot com Privacy Policy