Jump to content

Archived

This topic is now archived and is closed to further replies.

aurelou

301 redirects and SEO URLs

Recommended Posts

Hi all,

 

I want to make a few 301 redirects because I want to change structure of categories.

 

The problem is that I have Ultimate SEO URLs.

 

So when I make for exemple this redirection in .htaccess :

 

RedirectPermanent /test-c-42_120.html   http://www.mysite.com/new-c-130.html

 

 

It redirects to :

 

 

With the cPath of my old category at the end of the URL. So it doesn't work...

 

How can I do ?

 

Thank you very much.

Share this post


Link to post
Share on other sites

It's OK I solved it.

 

1. In general.php, REPLACE the line 

 

function tep_redirect($url) {

 

 

with this one :

 

 function tep_redirect($url,$type='') {

 

 

2. Before the line

 

header('Location: ' . $url)

 

 

add this line :

 

if($type=='301') header("Status: 301 Moved Permanently");

 

 

 

3. In index.php under <head> add :

 

   <?Php
 if ((int) $current_category_id == '42')  //Replace with your old ID category
 { tep_redirect(tep_href_link("xxx-c-40.html"),'301'); //Replace with the new URL
   }
 ?>

 

 

That's all.

Share this post


Link to post
Share on other sites

×