When it comes to making URL structural changes to your website, it is very important to ensure you 301 redirect your old URLs to the new URLs. Common cases of doing this are migrating between pages on a site or migrating between sites.
Doing 301 redirects for migrations has SEO and usability impact and if not followed correctly, may cost your site valuable organic traffic and rankings.
4 reasons why you should and must 301 redirect your old URLs:
- Search engines (such as Google) most likely have crawled and indexed your site on the SERPs. If a user then queries and finds your site organically on the SERPs, it would be poor user experience if the link found lead to a 404 page.
- Search engines may recrawl your site via the old URLs and if stumbles upon a 404 page, will most likely drop you out of the SERPs if they can’t see the association to the new URL. This is also because of poor user experience as search engines place high importance on ensuring users find what they’re looking for.
- You will lose link juice from external sites as these trust & authority juices aren’t flowed from the old URL to the new URL. Loss of link juice means your site will lose authority & trust: 2 important factors in SEO.
- If you did not update your internal links to point to the new URLs, you will have a lot of broken links too which will negatively affect your internal PageRank flow.
You’d be surprised but I have seen websites lose 50%+ organic traffic due to this oversight. Imagine if you ran a multi-million dollar e-commerce site. What are the implications of not doing this?
Continue reading »
In case you’re wondering whether 301 redirects preserve the referrer information or not and how this may affect Google Analytic’s referrer information, I’ll show you a simple example.
So pretty much what I did was I did a Google search for clothes and found some ads on the right hand side. I used firebug to extract the destination URL as I didn’t want to inflate their costs because I’m just doing an example. What I look for are obvious tracking URLs that track and monitor search engine marketing (SEM) campaigns such as DART (Double Click).
You can also figure this one out by seeing the domain of the URL. If this is different to the display URL, most likely this is a tracking URL because Google Adwords has enforced the policy that the destination and display URL must be the same (it’s ok to use tracking URLs though as long as you land on the same domain as the display URL).
If you’re trying to do some testing on your existing WordPress website locally (using something like XAMPP) using the same files and database but find that it keeps 302 redirecting to your website rather than running it locally, you will have to configure your WordPress options to set your home and site URL to your local address.
Since you can’t even access your WordPress admin interface because of the redirects, you’ll have to configure this on the backend, your database.
Run your trustworthy phpMyAdmin or your favourite SQL client, connect to your local database and browse to your WordPress database (this is usually prefixed with wp_). Then browse to a table called wp_options or wp_kicpl0_options and look for a table field called siteurl.
The current value of this field should be your website. Edit this field value to your local address (i.e. http://localhost/wordpress). Remember NOT to use a / at the end. Save this.
The next field to edit is called home. If you can’t find this field on your current view in phpMyAdmin, it’s probably on the next page of fields. Edit this field value to the same value you used in siteurl. Save this.
Once you’ve edited both fields, just simply type in your local address again in your browser and you should be running your website locally instead of being redirected to your online website.
First of all, let me clarify briefly on my previous post and inform you what the core strengths of my script are.
- Strengths of my script are:
- It works.
- You need a client-side solution if you’re on Blogger. No other way.
- It captures and redirects all traffic from your old site to your new site.
That being said, let me now expand on these two major points: the limitations of search engine crawlers and why is capturing traffic important.
I have tested it on my old blogger (http://dannynsl.blogspot.com) and it seems to have worked fine so far.
There are a few steps you will first need to do.
- Install WordPress on your domain. There should be installation tutorials on the website. I haven’t had time yet to do my own installation tutorial.
- Import your Blogger posts into WordPress. In your dashboard, go to Manage and then Import.
- Change your permalink structure. In your dashboard, go to Settings and then Permalinks. The Day and name or Month and name settings should work. However, for my script I think Month and name should be safer.
When assigning values to old_root_domain and new_root_domain, DO NOT use ‘/’ at the end.
If you want to do a 302 redirect equivalent, just change the number in the meta content from 0 to 1 or 2.
Hope this works for you and please let me know if there are any bug issues.
I just fixed the code to accommodate blog addresses with ‘www’ subdomains. As for redirects for labels, I’ll try to update the code for it tomorrow if I have time.
I’ve added a new regular expression to handle labels and also another variable tag_url that points to your permalink structure for tags or categories.
This setting can be found under Setting, then Permalinks and just scroll right down to the bottom. You will need to edit the variable tag_url to what you’ve sent in the permalinks structure. Make sure you add the ‘/’ at the end of it.
I think by default, WordPress automatically imports posts from Blogger and sets the labels to categories instead of tags. In this case, just set the variable to the category slug name unless you can be bothered to go through all the posts and set them as tags instead.
Just found a bug (thanks to Chris Lee) that the redirection didn’t seem to work in IE7. For some reason I needed to add URL= in the meta content attribute for the redirection to work.
Basically I just changed,
document.write(“<meta content=’0;” + new_root_domain + redirect_suffix + “‘ http-equiv=’refresh’/>”);
document.write(“<meta content=’0;URL=” + new_root_domain + redirect_suffix + “‘ http-equiv=’refresh’/>”);
Please let me know if you guys ever come across bugs for this script and I will try my best to fix it as soon as possible :)
Happy Valentines Day everyone!