View Single Post
  #1  
Old 08-16-2016, 08:41 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default htaccess redirect for new directory structure and https

We're going live with the new x5 store soon and some of the URLs have changed so we need to set up 301 redirects.

We also want to make the entire store https. This also requires 301 redirects to avoid dropping pages in Google.

I have the following. Will this make every request https and also redirect the categories?

Code:
RewriteCond %{HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} RewriteRule ^category-path/ /new-root-cat/category-path/ [R=301,L] RewriteRule ^category-path2/ /new-root-cat/category-path2/ [R=301,L]

I'm not sure if the second line should be 301 as well to cover the categories that don't match the following rewrite rules.
__________________
Core version: 5.5.xx
Reply With Quote