DARKF3D3 Posted October 14, 2014 Share Posted October 14, 2014 (edited) On my store I had Italian and English language enabled, since i didn't need English i disabled it.So now all website page link changed from:www.mystore.it/it/..........To:www.mystore.it/..........Someone know what htaccess redirect 301 rule I can use to redirect all the pages with "it/" to the actual page without it?EDIT: Link to the shop in signature Edited October 14, 2014 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
DrunkBug Posted October 14, 2014 Share Posted October 14, 2014 Before this line in your .htaccess file: # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again Add this .htaccess rule: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^it/(.*)$ %{ENV:REWRITEBASE}$1 [L] </IfModule> I hope it will fit your needs. Link to comment Share on other sites More sharing options...
DARKF3D3 Posted October 14, 2014 Author Share Posted October 14, 2014 Hi DrunkBug, i just tested your code but it seems that nothing happens. Try with the url in signature and on a random page add it/ just after the website-name.it/ Link to comment Share on other sites More sharing options...
DrunkBug Posted October 14, 2014 Share Posted October 14, 2014 (edited) Paste your .htaccess file. Because this code works on my localhost. Edited October 14, 2014 by DrunkBug (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted October 14, 2014 Share Posted October 14, 2014 turn off and then turn on friendly url's, this will re-generate your .htaccess file clear browser cache, and retest. Link to comment Share on other sites More sharing options...
DARKF3D3 Posted October 14, 2014 Author Share Posted October 14, 2014 (edited) i cleared cache and also try to disable/enable SEF url. I also tried from different browser but it seems that nothing happen.This is my .htaccess code before # ~~start~~ Do not remove this comment,... ... # fix 1 <IfModule mod_rewrite.c> RewriteEngine on RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^it/(.*)$ %{ENV:REWRITEBASE}$1 [L] </IfModule> # fix 2 RewriteEngine on RewriteCond %{QUERY_STRING} ^id_product=([0-9]*)$ RewriteRule ^product\.php$ http://my-website.com/index.php?id_product=%1&controller=product [R=301,L] Edited October 14, 2014 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
DrunkBug Posted October 14, 2014 Share Posted October 14, 2014 Can you paste your whole .htaccess file? Link to comment Share on other sites More sharing options...
DARKF3D3 Posted October 14, 2014 Author Share Posted October 14, 2014 (edited) # fix 1 <IfModule mod_rewrite.c> RewriteEngine on RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^it/(.*)$ %{ENV:REWRITEBASE}$1 [L] </IfModule> # fix 2 RewriteEngine on RewriteCond %{QUERY_STRING} ^id_product=([0-9]*)$ RewriteRule ^product\.php$ http://my-website.com/index.php?id_product=%1&controller=product [R=301,L] # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums <IfModule mod_rewrite.c> <IfModule mod_env.c> SetEnv HTTP_MOD_REWRITE On </IfModule> RewriteEngine on RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # Images RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L] RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L] RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L] # AlphaImageLoader for IE and fancybox RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L] # Dispatcher RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L] </IfModule> AddType application/vnd.ms-fontobject .eot AddType font/ttf .ttf AddType font/otf .otf AddType application/x-font-woff .woff <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 1 week" ExpiresByType text/javascript "access plus 1 week" ExpiresByType application/javascript "access plus 1 week" ExpiresByType application/x-javascript "access plus 1 week" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" ExpiresByType image/vnd.microsoft.icon "access plus 1 year" ExpiresByType application/font-woff "access plus 1 year" ExpiresByType application/x-font-woff "access plus 1 year" ExpiresByType application/vnd.ms-fontobject "access plus 1 year" ExpiresByType font/opentype "access plus 1 year" ExpiresByType font/ttf "access plus 1 year" ExpiresByType font/otf "access plus 1 year" ExpiresByType application/x-font-ttf "access plus 1 year" ExpiresByType application/x-font-otf "access plus 1 year" </IfModule> FileETag INode MTime Size <IfModule mod_deflate.c> <IfModule mod_filter.c> AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript </IfModule> </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 Edited October 14, 2014 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted October 14, 2014 Share Posted October 14, 2014 did you add code to remove product and category id's? Link to comment Share on other sites More sharing options...
DrunkBug Posted October 14, 2014 Share Posted October 14, 2014 Maybe try to disable Apache MultiViews? Also, do you have any custom modules installed? Link to comment Share on other sites More sharing options...
DARKF3D3 Posted October 14, 2014 Author Share Posted October 14, 2014 (edited) did you add code to remove product and category id's? No, the # fix 2 code is for fix the 404 problem i had with product link of my old PS1.4.9. Maybe try to disable Apache MultiViews? Also, do you have any custom modules installed?Where I can disable Apache MultiViews? Regards last question, you mean PS modules? Edited October 14, 2014 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted October 14, 2014 Share Posted October 14, 2014 I don't understand then how product and category id's are missing. Link to comment Share on other sites More sharing options...
DrunkBug Posted October 14, 2014 Share Posted October 14, 2014 No, the # fix 2 code is for fix the 404 problem i had with product link of my old PS1.4.9. Where I can disable Apache MultiViews? Regards last question, you mean PS modules? Look in Preferences -> SEO & URL's, theres an option to disable Apache MultiViews. I don't understand then how product and category id's are missing. I can see ID's of products and categories, are we looking at the same page? Link to comment Share on other sites More sharing options...
El Patron Posted October 14, 2014 Share Posted October 14, 2014 what page you looking at drunkbug? the original poster removed the url so heck if I know...me thinks one should leave working shop alone, those that continue to modify things...lets just say disabling a language is not an issue in native... Link to comment Share on other sites More sharing options...
DrunkBug Posted October 14, 2014 Share Posted October 14, 2014 what page you looking at drunkbug? the original poster removed the url so heck if I know...me thinks one should leave working shop alone, those that continue to modify things...lets just say disabling a language is not an issue in native... As OP said, I'm looking at site in his signature - http://store.dottorgadget.it/ I agree with you, it's very hard to tell what was changed during development of the shop. And how to make things work again. Link to comment Share on other sites More sharing options...
El Patron Posted October 14, 2014 Share Posted October 14, 2014 as to OP said, link where the f is that...have to read every post to find out see his signature? that is not the shop I looked at originally. jajajaja to early for a drink...but not to early to break the windows out of the bar. I'm red today...thanks for your continued contributions drunkbug... to original poster, please take a little bit of time and extra effort to provide better info in original post...what you did so we don't play 20 questions with responses I did that already, my advice is once you get 'working' shop 'working' again, back it up and leave it alone. now removing English, you lost x1 seo in sitemap. Link to comment Share on other sites More sharing options...
DARKF3D3 Posted October 14, 2014 Author Share Posted October 14, 2014 (edited) Yes El Patron, you're right, I'm sorry but I forgot to indicate in my first post that the url was in signature. now removing English, you lost x1 seo in sitemap. English was Enabled by the person who upgraded my store from 1.4.9 to 1.6.0.9. I never used English and I didn't notice this problem with url since few days ago. Now I'm trying to fix this problem with all these 404 errors. Look in Preferences -> SEO & URL's, theres an option to disable Apache MultiViews. I just tried but nothing different happens... Really strange if this works for you but not for my website. Edited October 14, 2014 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts