Call us at 847-HEY-MAAN or Get your FREE quote

HeyMaan Inc. - Chicago based website design company.
Wednesday, 23 May 2012 19:00

Creating 301 redirects using .htaccess file

Written by 

So you have your news site build and ready to roll with it?! Nice and congrats! But what about the traffic that you had to your old site? What about your old links? Keep the traffic you had - redirect traffic to your new links. Here is a way to do it using .htaccess file in your website root folder...

So you have your news site build and ready to roll with it?! Nice and congrats!

But what about the traffic that you had to your old site? What about your old links? Keep the traffic you had - redirect traffic to your new links. 

Here is a way to do it using .htaccess file in your website root folder: 

Firstly add line: RewriteEngine On 

Then add line for every link you want to rewrite: 

 

RewriteCond %{QUERY_STRING} ^page=shop.product_details&flypage=flypage.tpl&product_id=20&category_id=1$

RewriteCond oldlink/oldlink.php
RewriteRule newlink/newlink.php [L,R=301]

In real life it would look like: 

 

RewriteCond %{QUERY_STRING} ^page=shop.product_details&flypage=flypage.tpl&product_id=20&category_id=1$
RewriteRule ^products$ http://anywebsite.net/store/index.php?page=shop.product_details&category_id=null&flypage=flypage.tpl&product_id=6&option=com_virtuemart&Itemid=112&vmcchk=1&Itemid=112 [L,R=301]

 

Good luck with this!

Last modified on Thursday, 22 May 2014 03:44
 

Contact Us

Let's Work Together

Sending...
Send Another Inquiry
Error occured
Retry
Server Error occured
Retry

900 West Jackson, 7E-2
Chicago, IL 60607
Phone: 847-439-6226

We are open Monday to Friday from 9 a.m. to 5p.m.

 

Fun facts

Clients

60 percent of our work is done in partnerships under NDA.

Projects

89 percent of our projects are done in Joomla! CMS.

Staff

80 percent of our awesome team members are under thirty.

Local

76 percent of our projects are done for Chicago based businesses.