Jump to content

[RESOLU] redirection monsite.com vers www.monsite.com


Recommended Posts

Bonjour,

je sais que ce sujet a déjà été traité mais les solutions proposées ne marchent pas chez moi.

J'ai essayé de modifier le .htaccess comme suit :

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
# Forcer la page index.php et rediriger vers /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]
# Forcer le sous-domaine
RewriteCond %{HTTP_HOST} !^www\.avenuedeladeco\.com
RewriteRule (.*) http://www.avenuedeladeco.com/$1 [R=301,L]

#Redirection 301 non-www vers www
RewriteCond %{HTTP_HOST} ^avenuedeladeco.com$
RewriteRule ^(.*) http://www.avenuedeladeco.com/$1 [L,R=301]

# URL rewriting module activation
RewriteEngine on
# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]
# Catch 404 errors
ErrorDocument 404 /404.php

 

quelqu'un voit le problème ?

Merci

Link to comment
Share on other sites

Bonjour,

 

La syntaxe classiqye

 

RewriteEngine on
RewriteCond %{HTTP_HOST} ^votresite.fr$
RewriteRule ^(.*) http://www.votresite.fr/$1 [QSA,L,R=301]

 

(attention la premiere ligne est à priori déjà dans votre htaccess, il ne faut pas la mettre 2 fois.)

Link to comment
Share on other sites

Ces deux éléments font un peu la même chose.

# Forcer le sous-domaine
RewriteCond %{HTTP_HOST} !^www\.avenuedeladeco\.com
RewriteRule (.*) http://www.avenuedeladeco.com/$1 [R=301,L]

#Redirection 301 non-www vers www
RewriteCond %{HTTP_HOST} ^avenuedeladeco.com$
RewriteRule ^(.*) http://www.avenuedeladeco.com/$1 [L,R=301]

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...