Jump to content

Redirect 301


Apsides

Recommended Posts

Hi,

 

i have a problem with some htaccess redirect 301 i need.

I'm using Prestashop 1.5.1 with multi stores option (about 20 stores on it) and i need for a specific domain a 301 redirect.

 

I want :

- call from http://www.XXXXX.com...gorie.php?cat=1

- Redirect to http://www.XXXXX.com...egory&id_lang=5

 

I already tryed (before the ~~start~~) :

 

Redirect 301 /categorie.php?cat=1 http://www.XXXX.com/index.php?id_category=3&controller=category&id_lang=5

 

RedirectPermanent /categorie.php?cat=1 http://www.XXXXX.com/index.php?id_category=3&controller=category&id_lang=5

 

RewriteEngine on
RewriteCond %{REQUEST_URI} ^(.*)/categorie.php?cat=1$
RewriteRule ^(.*)$ http://www.XXXXX.com/index.php?id_category=3&controller=category&id_lang=5 [L,R=301]

 

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.XXXX.com$
RewriteRule ^categorie.php?cat=1$ index.php?id_category=3&controller=category&id_lang=5 [L,R=301]

 

None of this works, anyone got solution ?

Edited by Apsides (see edit history)
Link to comment
Share on other sites

I found a solution because i was lucky enough that old URL used to be in french so there was no file with the name called in URL.

 

So, i'll give my answer (even if no one answered).

 

Create a file "categorie.php" and put :

 

<?php
 switch($_GET["cat"]) {
   case '1':
  header('Location: http://'.$_SERVER["SERVER_NAME"].'/index.php?id_category=3&controller=category&id_lang=5');
  break;
   case '2':
  header('Location: http://'.$_SERVER["SERVER_NAME"].'/index.php?id_category=8&controller=category&id_lang=5');
  break;
 }
?>

 

This is not htaccess using but, tbh, i've tryed everything i could !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...