Aurélia222 Posted January 18, 2018 Share Posted January 18, 2018 Bonjour, Je trouve rien sur le net :Savez vous combien de redirection permanente peut on rajouter dans le fichier htaccess sans le surcharger ?? Link to comment Share on other sites More sharing options...
doekia Posted January 18, 2018 Share Posted January 18, 2018 Car c'est dépendant de ton serveur et de ton trafic. A chaque page lu, la totalité du .htaccess et analyser. Tu veux mettre combien de redirection ? Link to comment Share on other sites More sharing options...
Aurélia222 Posted January 18, 2018 Author Share Posted January 18, 2018 environ 200 url Link to comment Share on other sites More sharing options...
Aurélia222 Posted January 18, 2018 Author Share Posted January 18, 2018 à chaque produits plusieurs catégories étaient attribuées et lorsque je faisais de l'import de xml, mes urls changeaient tout le temps. j'ai donc modifié la forme de mes urls et supprimé la catégorie de mes urls produits. Et donc logique je me tape un max de 404 sur GWT donc petit à petit je redirige . Link to comment Share on other sites More sharing options...
doekia Posted January 18, 2018 Share Posted January 18, 2018 Ça commence a faire, mais ne devrait pas être sensible sauf si ton trafic est important 1 Link to comment Share on other sites More sharing options...
doekia Posted January 18, 2018 Share Posted January 18, 2018 Donc une seule redirection est necessaire. http://area51.enter-solutions.com/snippets/44 Link to comment Share on other sites More sharing options...
Aurélia222 Posted January 18, 2018 Author Share Posted January 18, 2018 niveau trafic , il faut compter les visiteurs ou visiteurs + robots ?? OK merci pour le lien donc dans le fichier j'indique qu'il redirige en masse mais il y a 2 méthodes : je copie le script ou je choisis juste 1 méthode désolé mais je suis pas experte Link to comment Share on other sites More sharing options...
doekia Posted January 18, 2018 Share Posted January 18, 2018 Comme expliqué, la méthode 2 est meilleure, elle évite de référencer des pages 404 Link to comment Share on other sites More sharing options...
Aurélia222 Posted January 18, 2018 Author Share Posted January 18, 2018 <IfModule mod_rewrite.c> RewriteEngine On #RewriteCond %{HTTP_HOST} ^www.lesecretdubienetre-shop.fr$ #RewriteRule . - [E=REWRITEBASE:/] # # Remove category-url from product url method 2 (prefered method) # no redirect here, only core will do #RewriteCond %{HTTP_HOST} ^www.lesecretdubienetre-shop.fr$ #RewriteRule ^.*/([0-9]+)-[_a-zA-Z0-9-]*\.html$ %{ENV:REWRITEBASE}index.php?controller=product&id_product=$1 [NC,QSA,L] </IfModule> est ce que c'est comme ça ? Link to comment Share on other sites More sharing options...
doekia Posted January 18, 2018 Share Posted January 18, 2018 Enlevé les commentaires devant les directives RewriteCond et RewriteRule de la méthode 2 (le # = commentaire ) Link to comment Share on other sites More sharing options...
Aurélia222 Posted January 18, 2018 Author Share Posted January 18, 2018 ok donc ensuite je fais copier coller à la place de celui ci dans le fichier ? #If rewrite mod isn't enabled ErrorDocument 404 /index.php?controller=404 MERCI beaucoup pour votre aide Link to comment Share on other sites More sharing options...
doekia Posted January 18, 2018 Share Posted January 18, 2018 Non. Tu copies le bloc avant le commentaire de la section prestashop dans ton .htaccess Link to comment Share on other sites More sharing options...
Aurélia222 Posted January 18, 2018 Author Share Posted January 18, 2018 j'ai essayé mais j'ai du mal comprendre quelque chose, car ça ne fonctionne pas , merci quand même Link to comment Share on other sites More sharing options...
Aurélia222 Posted January 18, 2018 Author Share Posted January 18, 2018 <IfModule mod_headers.c> Header unset Etag </IfModule> FileETag none <IfModule mod_deflate.c> <IfModule mod_filter.c> AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype image/svg+xml </IfModule> </IfModule> RewriteCond %{HTTP_HOST} ^www.lesecretdubienetre-shop.fr$ RewriteRule . - [E=REWRITEBASE:/] # # Remove category-url from product url method 2 (prefered method) # no redirect here, only core will do RewriteCond %{HTTP_HOST} ^www.lesecretdubienetre-shop.fr$ RewriteRule ^.*/([0-9]+)-[_a-zA-Z0-9-]*\.html$ %{ENV:REWRITEBASE}index.php?controller=product&id_product=$1 [NC,QSA,L] </IfModule> #If rewrite mod isn't enabled ErrorDocument 404 /index.php?controller=404 # ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again Voici ce que j'ai mit et le site a planté, est ce que vous voyez ou est ce que je me suis trompée ? Link to comment Share on other sites More sharing options...
doekia Posted January 18, 2018 Share Posted January 18, 2018 Avant!!! qu'est ce que tu ne comprends pas dans avant? Tu as purement et simplement corrompu ton .htaccess Va dans le BO, désactive les urls simplifiées, enregistre, réactive les urls simplifiées, enregistre. Ceci régénère un .htaccess Ensuite édite ce nouveau .htaccess et ajoute la section en début de fichier <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^www.lesecretdubienetre-shop.fr$ RewriteRule . - [E=REWRITEBASE:/] # # Remove category-url from product url method 2 (prefered method) # no redirect here, only core will do RewriteCond %{HTTP_HOST} ^www.lesecretdubienetre-shop.fr$ RewriteRule ^.*/([0-9]+)-[_a-zA-Z0-9-]*\.html$ %{ENV:REWRITEBASE}index.php?controller=product&id_product=$1 [NC,QSA,L] </IfModule> Link to comment Share on other sites More sharing options...
Aurélia222 Posted January 18, 2018 Author Share Posted January 18, 2018 J'avais bien compris avant mais je pensais avant ceci : #If rewrite mod isn't enabledErrorDocument 404 /index.php?controller=404 donc c'est au début du fichier que je dois rajouter votre script, je vais réessayé. j'ai récup mon ancien fichier ht access pour remettre le site en route car j'avais une copie. Link to comment Share on other sites More sharing options...
doekia Posted January 18, 2018 Share Posted January 18, 2018 Tu fais comme tu veux, je te donne la bonne méthode pour remettre ton site en fonction, tu t'en invente une autre si tu veux mais bon Link to comment Share on other sites More sharing options...
Aurélia222 Posted January 19, 2018 Author Share Posted January 19, 2018 Bonjour, hier j'ai répondu mais je ne vois pas mes réponses. Donc je recommence , j'avais déjà remis le site en route avant d'avoir votre réponse de regenerer l'ht access . du coup je l'ai quand même fait pour repartir sur de bonnes bases en suivant vos conseils. et ça fonctionne donc vous m'avez fait gagner bcp de temps en faisant 1 seule redirection au lieu de 200 encore merci de m'avoir guidé pas à pas Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now