3

Magento has the facility of 301/302 re-directs. I'm working on a project for which 301 works fine for each country, say if I'm visiting from India, it re-directs me to example.in from example.com . It's configured at System->Configuration->Web->Url Options->Auto-redirect to Base URL. Though I see re-directs are also configured in .htaccess file. like

RewriteCond %{REQUEST_URI} (.*)\.html
RewriteCond %{REQUEST_URI} [A-Z] 
RewriteRule . ${lc:%{REQUEST_URI}} [R=301,L]

RewriteCond %{HTTP_HOST} ^example\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

I see few other 301 re-directs are mentioned in .htaccess file like

RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI}  ^/ShowReviewDetails\.do$
RewriteRule ^(.*)$ http://www.example.com/saree.html? [R=301,L] 
# simple redirect
Redirect 301 /Craft.do    http://www.example.com/craft.html
Redirect 301 /Welcome.do  http://www.example.com/
Redirect 301 /Craft.do  http://www.example.com/craft.html

Which 301 re-direct is in action? I've to change all 301 re-directs to 302. Do I need to change 301->302 in admin section only or I need to change all occurrences of 301 to 302 in .htaccess file also?

Also, I see, in Catalog->URL Rewrite Management , 301 re-directs are enabled for each store view. Do I need to change it here also or I need to make change only at System->Configuration->Web->Url Options->Auto-redirect to Base URL ?

  • what your question i not understand it – Ashvin Monpara Jul 1 '15 at 13:48
  • use in .htaccess file Try changing the last line to this: RewriteRule .* index.php [R=301,L] in – Ashvin Monpara Jul 1 '15 at 13:58
  • @Ashvin: I want to do 302 URL re-directs for the site instead of using 301(presently active). – amitshree Jul 1 '15 at 14:05
  • hi frinds admin go to System > Configuration > Web > URL Options > Auto-redirect to Base URL and than change the option for 301.collaboration133.com/… – Ashvin Monpara Jul 1 '15 at 14:15
0

Your .htaccess file will be parsed before Magento will lookup its rewrite rules.

So if you want to handle a domain-level redirection with a 302, just change your .htaccess file and that's it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.