JSHD Posted July 14, 2011 Share Posted July 14, 2011 HelloIf i place the code below is my fresh generated .htaccess file i am getting an internal error.What am i doing wrong? RewriteEngine on RewriteCond %{QUERY_STRING} ^id_cms=4$ RewriteRule ^/cms.php$ http://multihout.nl/content/16-over-multihout [L,R=301] RewriteEngine on RewriteCond %{QUERY_STRING} ^id_cms=2$ RewriteRule ^/cms.php$ https://multihout.nl/contact-form.php?fid=1 [L,R=301] RewriteEngine on RewriteCond %{QUERY_STRING} ^id_cms=5$ RewriteRule ^/cms.php$ http://multihout.nl/content/7-veilig-betalen [L,R=301] RewriteEngine on RewriteCond %{QUERY_STRING} ^id_cms=8$ RewriteRule ^/cms.php$ http://multihout.nl/content/11-veel-gestelde-vragen [L,R=301] Link to comment Share on other sites More sharing options...
JSHD Posted July 14, 2011 Author Share Posted July 14, 2011 OK, after viewing many hundreds of pages i finally found a solution for good 301 Redirecting. Too bad this info wasn't available on this forum and nobody replies at all. But hell.. here is the way you can do it..Step 1 is to put off all your SEO configuration from you OLD and NEW site. Simply turn Friendly URL off in the Dashboard and generate a fresh .htaccess file.Step 2is to create a fresh text file.Start the file with RewriteEngine on Then add the flowing code for every:Category-page:If my old page is: http://www.example.nl/shop/category.php?id_category=37And my new page is: http://example.nl/category.php?id_category=1000 RewriteCond %{QUERY_STRING} ^id_category=(37)$ RewriteRule ^category\.php$ http://example.nl/category.php?id_category=1000 [L,R=301] Product-page: If my old page is: http://www.example.nl/shop/product.php?id_product=5And my new page is: http://example.nl/product.php?id_product=151005 RewriteCond %{QUERY_STRING} ^id_product=(5)$ RewriteRule ^product\.php$ http://example.nl/product.php?id_product=151005 [L,R=301] CMS-pageIf my old page is: http://www.example.nl/shop/cms.php?id_cms=9And my new page is: http://example.nl/cms.php?id_cms=7 RewriteCond %{QUERY_STRING} ^id_cms=(9)$ RewriteRule ^cms\.php$ http://example.nl/cms.php?id_cms=7 [L,R=301] Index.php-pageIf my old page is: http://www.example.nl/shop/index.phpAnd my new page is: http://example.nl/index.php Redirect 301 /shop / Step 3Is to save the file just made to a .htaccess file and place it in the root of your OLD site!(Your file should look like this:) RewriteEngine on RewriteCond %{QUERY_STRING} ^id_category=(37)$ RewriteRule ^category\.php$ http://example.nl/category.php?id_category=1000 [L,R=301] RewriteCond %{QUERY_STRING} ^id_cms=(5)$ RewriteRule ^cms\.php$ http://example.nl/cms.php?id_cms=7 [L,R=301] RewriteCond %{QUERY_STRING} ^id_product=(5)$ RewriteRule ^product\.php$ http://example.nl/product.php?id_product=151005 [L,R=301] Step 4Test if this configuration works for you. For me it works 100%!Step 5Don't activate your friendly URL's of your old site. BUT you can activate the SEO configuration of your new site and generate a new .ht-access file through the dashboard.Finished 1 Link to comment Share on other sites More sharing options...
JSHD Posted July 15, 2011 Author Share Posted July 15, 2011 For the complete website to redirect end your .htaccess file (old website) with this code: # Catch 404 errors ErrorDocument 404 /shop/404.php RewriteEngine on # 404 Redirect 301 /shop/404.php /404.php # BEST SALES Redirect 301 /shop/best-sales.php /best-sales.php # AUTHENTICATION Redirect 301 /shop/authentication.php /authentication.php # ADDRESS Redirect 301 /shop/address.php /address.php # ADDRESSES Redirect 301 /shop/addresses.php /addresses.php # ATTACHMENT Redirect 301 /shop/attachment.php /attachment.php # CART Redirect 301 /shop/cart.php /cart.php # REMAINING AND FORGOTTEN CATEGORIES Redirect 301 /shop/category.php /category.php # CONTACT-FORM Redirect 301 /shop/contact-form /contact-form.php # DISCOUNT Redirect 301 /shop/discount.php /discount.php # IDENTITY Redirect 301 /shop/identity.php /identity.php # MY ACCOUNT Redirect 301 /shop/my-account.php /my-account.php # NEW-PRODUCTS Redirect 301 /shop/new-products.php /new-products.php # ORDER-CONFIRMATION Redirect 301 /shop/order-confirmation.php /order-confirmation.php # ORDER-DETAIL Redirect 301 /shop/order-detail.php /order-detail.php # ORDER-FOLLOW Redirect 301 /shop/order-follow.php /order-follow.php # ORDER-RETURN Redirect 301 /shop/order-return.php /order-return.php # ORDER-SLIP Redirect 301 /shop/order-slip.php /order-slip.php # PAGINATION Redirect 301 /shop/pagination.php /pagination.php # PASSWORD Redirect 301 /shop/password.php /password.php # PRICES DROP Redirect 301 /shop/prices-drop.php /prices-drop.php # REMAINING AND FORGOTTEN PRODUCTS Redirect 301 /shop/product.php /product.php # SEARCH Redirect 301 /shop/search.php /search.php # SITEMAP Redirect 301 /shop/sitemap.php /sitemap.php # SUPPLIER Redirect 301 /shop/supplier.php /supplier.php # MANUFACTURER Redirect 301 /shop/manufacturer.php /manufacturer.php # INDEX Redirect 301 /shop/index.php /index.php Link to comment Share on other sites More sharing options...
SonnyBoyII Posted January 20, 2012 Share Posted January 20, 2012 Thanks for your post. Unfortunately, I still have problems with redirection.... For example: I cant redirect page www.domain.co.uk/index.html to www.domain.co.uk/ I have tried many ways and still lands on "page-not-found" page .... Link to comment Share on other sites More sharing options...
bicyus Posted November 6, 2012 Share Posted November 6, 2012 (edited) im trying to redirect OLD_CATEGORY to NEW_CATEGORY with Redirect 301 /10-jim-shore-s-disney-traditions /4_jim-shore or Redirect 301 10-jim-shore-s-disney-traditions /4_jim-shore it's not working until i try with dual slashes www.domain.tld//10-jim-shore-s-disney-traditions and i get the new url. But every time i try with normal single slash (/) y got 404. Any clues? Edited November 6, 2012 by bicyus (see edit history) Link to comment Share on other sites More sharing options...
Lachaussettenoire Posted November 25, 2012 Share Posted November 25, 2012 I am new in prestashop but have a couple of wordpress sites. Wordpress is so nice, one of the reasions is all the nice plugins that makes life easyer. Regarding to 301 re, then this http://wordpress.org/extend/plugins/simple-301-redirects/ plugin is so nice. Can we not get something like that for prestashop please ? Link to comment Share on other sites More sharing options...
Recommended Posts