Where to put 301 redirects in Magento?
-
I will be changing the URL structure in a magento store from "base/category/subcategory/product" to "base/product" which means i have to make over 1000 URL 301 redirects so our old links still work.
Should i put the redirects in a .htaccess file so they stay intact no matter what or should i just put them in with all the other rewrites (in Magento 's URL rewrite manager)?
Thanks
-
Yes I suppose it would check everytime. That said, i have written files with several hundred lines of code and the sites still load really fast even on shared servers which are not the best...
-
Will that in any way slow down the site? Adding thousands of lines of code to the .htaccess file?
Edit: Checked some more, apparently having thousands of redirects in .htaccess file shows things downs, since Apache scans the file each time a new page is opened.
tl/dr: Stick with magento URL rewrites
-
I think either is fine as long as it works. Personally I prefer to writ my own .htaccess files as I then understand exactly what I have done - it feels safer for some reason.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Resolving 301 Redirect Chains from Different URL Versions (http, https, www, non-www)
Hi all, Our website has undergone both a redesign (with new URLs) and a migration to HTTPS in recent years. I'm having difficulties ensuring all URLs redirect to the correct version all the while preventing redirect chains. Right now everything is redirecting to the correct version but it usually takes up to two redirects to make this happen. See below for an example. How do I go about addressing this, or is this not even something I should concern myself with? Redirects (2) <colgroup><col width="123"><col width="302"></colgroup>
Technical SEO | | theyoungfirm
| Redirect Type | URL |
| | http://www.theyoungfirm.com/blog/2009/index.html 301 | https://theyoungfirm.com/blog/2009/index.html 301 | https://theyoungfirm.com/blog/ | This code below was what we added to our htaccess file. Prior to adding this, the various subdomain versions (www, non-www, http, etc.) were not redirecting properly. But ever since we added it, it's now created these additional URLs (see bolded URL above) as a middle step before resolving to the correct URL. RewriteEngine on RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] RewriteCond %{HTTPS} !on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] Your feedback is much appreciated. Thanks in advance for your help. Sincerely, Bethany0 -
1000 Pages on old website. What to do with the 301 redirects for this domain?
Hi Moz Community, I have a 301 redirect question... I just acquired an old domain: Totally in my niche Domain is 14 years old Website exists of 1000 pages Great amount of backlinks Website is offline since about 2 weeks Will place a new website online asap with new url structure For the 50 best scoring pages I wrote a new, but fully comparable/related article. I will put a 301 redirect from those old to the new pages. My question: What to do with the 950 other url's? Should I put a 301 redirect to the homepage? Should I forward those pages to the 404 page? Should I divide the 950 url's with a 301 redirect to the 50 new ones? Another solution maybe? Any idea what would be the best solution so we can save as much Google juice as possible? Thanks in advance!
Technical SEO | | snorkel0 -
Is there anyway to automatically find complete urls for 301 redirects?
Hello all, I'm working on a large site that is being prepared for a migration. After scraping on screaming frog, WMT, and deepcrawl, and deduping I have a list of 404 pages that need redirected. Many of these URLs are just incomplete URLs. For example the incomplete URL would be: "https://moz.com/beginners-guide-to" when it should be "https://moz.com/beginners-guide-to-seo" I have been finding the correct page manually searching google. With hundreds more to go, I am looking for a way the would be a little less laborious. Thanks! https://moz.com/beginners-guide-to-seo
Technical SEO | | AdamBohr0 -
301 redirect: canonical or non canonical?
Hi, Newbie alert! I need to set up 301 redirects for changed URLs on a database driven site that is to be redeveloped shortly. The current site uses canonical header tags. The new site will also use canonical tags. Should the 301 redirects map the canonical URL on the old site to the corresponding canonical for the new design . . . or should they map the non canonical database URLs old and new? Given that the purpose of canonicals is to indicate our preferred URL, then my guess is that's what I should use. However, how can I be sure that Google (for example) has indexed the canonical in every case? Thx in anticipation.
Technical SEO | | ztalk1120 -
Canonicial redirect non-www to WWW in Magento
I am wondering if I have covered the non-www to www redirect in my Magneto OK? I have nominated the preferred URL in google webmasters. I have selected the correct boxes in Magento admin. when I type the "no www" version it redirects OK. Should I still be adding something to .htaccess? Thanks
Technical SEO | | Paul_MC0 -
302 to 301 redirect
Our site has quite a few 302 redirects that really ought to be 301's. Our IT department is really busy so the question is, given that the 302's have probably been in place for years, is it worth changing them to 301's now? Thanks
Technical SEO | | Houses0 -
301 redirect blog posts from old URL to new one
I moved a wordpress blog from domain.com to domain.com/blog . I want to redirect the links in google from the old domain.com to the new one, but I also want to put a new site/application at domain.com..so I'm thinking an .htaccess 301 redirect at the root wouldn't work. Any tips?
Technical SEO | | callmeed0 -
Need Help writing 301 redirects in .htaccess file
SEOmoz tool shows me 2 errors for duplicate content pages (www.abc.com and www.abc.com/index.html). I believe, the solution to this is writing 301 redirects I need two 301 redirects 1. abc.com to www.abc.com 2. /index.html to / (which is www.abc.com/index.html to www.abc.com) The code that I currently have is ................................................... RewriteEngine On
Technical SEO | | WebsiteEditor
RewriteCond %{HTTP_HOST} ^abc.com
RewriteRule (.*) http://www.abc.com/$1 [R=301,L] Redirect 301 http://www.abc.com/index.html http://www.abc.com ...................................................... but this does not redirect /index.html to abc.com. What is wrong here? Please help.0