Welcome to the new Compass Designs website, powered by Joomla 1.5! The goal of this new site is to be the place to bookmark if you are looking for quality Joomla  tutorials, news and tips.

How to Redirect old URLs after migrating

Posted on Mar 06, 2008
Tagged in SEFmigrationjoomla 1.5compassdesigns.net

OK, so in my last post, Live Day 1 SEF URL problems I explained my master plan to do some htaccess redirection for all my old links.

Now, despite my current issue getting data on 404's, I can still make some headway because I *do* know some of the URL's that need redirecting. 

The best resource I have managed to find for htaccess, 301 Redirects & SEO is this. Based on this, we will do a few things.

As I have discussed before (Get Free Pagerank for your Joomla Website), you should always redirect non-www to www so you can concentrate your page rank. This needs this in your htaccess file:

rewritecond %{http_host} ^compassdesigns.net [nc]
rewriterule ^(.*)$ http://www.compassdesigns.net/ [r=301,nc]

Next, if you have been watching, I was making the site on makeajoomlablog.com. We need to redirect any old links:

RewriteCond %{HTTP_HOST} ^www.makeajoomlablog.com$ [NC]
RewriteRule ^(.*)$ http://www.compassdesigns.net/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^makeajoomlablog.com$ [NC]
RewriteRule ^(.*)$ http://www.compassdesigns.net/$1 [R=301,L]

Next, we can redirect a few of the links I know are popular:

Redirect 301 /new-joomla-book http://www.compassdesigns.net/joomla-blog/New-Joomla-Book.html
Redirect 301 /tutorials/joomla-tutorials/joomla-template-tutorial.html http://www.compassdesigns.net/tutorials/17-joomla-tutorials/48-joomla-template-tutorial.html

Now the next bit is tricksy. We have a boatload of URL's out there for various (say) tutorial links. We don't want to have to go through one by one, so lets redirect them all to the same page where people can see a list of all the new ones.

RewriteRule ^tutorials/joomla-tutorials(.*)$ http://www.compassdesigns.net/tutorials.html [L,R=301]

Now we are staring to reduce the traffic on that 404 page!


Comments (12)add comment

trichnosis said:

Hi;

I was using opensef for Joomla 1.0.x and i'm currently waiting a stable sef component for j1.5 . i will use joomla 1.5 after thissmilies/smiley.gif
March 08, 2008 | url

Ricardo Corai said:

I´m using SEF Advance for J! 1.0.x but I don´t know if is convenient still using this extension or only J! 1.5.x with short URLs.
Any suggestion?
March 29, 2008 | url

Administrator said:

@Ricardo
I am going to be making a longer post next week about this issue... stay tuned....!
March 30, 2008

Ricardo Corai said:

Thank you! smilies/wink.gif
March 30, 2008 | url

trichnosis said:

staying joomla 1.0.x forever is a better alternative because of the backlink smilies/sad.gif
March 30, 2008 | url

damodamodamo said:

in the post above you say this code should be added to your .htaccess:

rewritecond %{http_host} ^compassdesigns.net [nc]
rewriterule ^(.*)$ http://www.compassdesigns.net/ [r=301,nc]

clearly you'd change compassdesigns.net to your own domain name, but in the previous post you refer to above, you suggest the following code:

RewriteCond %{HTTP_HOST} ^yoursite.com$ [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]

they're both very similar but the second one has the '' in the non www URL

is there any significance to this?
April 24, 2008

damodamodamo said:

the backslash hasn't shown up above. if you look here:
http://www.compassdesigns.net/...bsite.html

you'll see what i mean about the backslash ..
April 24, 2008

Administrator said:

The $ is a variable, you'd probably be better off with that one....
April 24, 2008

damodamodamo said:

yep, but in the previous post here:
http://www.compassdesigns.net/...bsite.html

you've got a backslash right before the .com in the first line. is that supposed to be there, because it's not in the example above
April 24, 2008

Administrator said:

Ahhh, that's just escaping the period. You can get by without it I think
April 24, 2008

Mark said:

Is there an advantage to using the .htaccess method instead of using Sh404SEF's method of building them inside of the joomla component? There you can search for top 404s, and then redirect them as you wish.

Seems more efficient, but not sure if it's kosher for Google rules. I believe Sh404sef is set up to do 301 redirects and avoid duplicate entries.
May 07, 2008

Administrator said:

@Mark

I don't think so. My self imposed goal on this site was to use native 1.5 SEF. I think using sh404's redirects is probably better than messing around with htaccess.

I just like to make things difficult for myself smilies/smiley.gif
May 08, 2008

Write comment
You must be logged in to a comment. Please register if you do not have an account yet.

busy

Did you enjoy this Compass Design blog post/tutorial?

Then sign up for regular monthly newsletter. I'll send you great tips on Joomla, email only offers and news from the Joomlasphere.

Email: First Name:

Find more posts tagged with...

RSS Feed For The Joomla Blog


Joomla 1.5 Book

Get the "have to have book" about Joomla 1.5 from Amazon and free access to the companion site, joomlabook.com.

Joomla 1.0 eBook

Get the best selling Joomla 1.0 Admin Manual eBook

Also available in hard copy from
Support independent publishing: buy this book on Lulu.

Who's Here

We have 242 guests online