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
-
Ranking for non-existing content which is 301 redirected
Hey there, In the beginning of this year I've made complete site migration from Dutch language to English. All the old Dutch URL's were 301 redirected to the English versions. I naturally lost rankings for all Dutch keywords during the next month. On the website there is no Dutch content anymore. But what happened now is that five months later the website started to rank for the Dutch keywords again. The page snippets in SERP are in English but the URL's shown are in Dutch (ending with .nl) and whenever a user clicks on the snippet he/she gets 301 to the correct English version. Any ideas what could be the reason for re-ranking of non-existing pages which gets 301 in SERP?
Technical SEO | | benesmartin0 -
404 to 301 redirects is there a limit?
Hi We've just updated our website and have binned out alot of old thin content which has no value even if re written. We have a lot of 404 error on WMT and I am in the process of doing 301 redirects on them. Is there a limit to the number of 301 the site should have?
Technical SEO | | Cocoonfxmedia0 -
Page for page 301 redirects from old server to new server
Hi guys:
Technical SEO | | cindyt-17038
I have a client who is moving their entire ecommerce site from one hosting platform (Yahoo Store) to another (BigCommerce) and from one domain to another. The old domain is registered with the Yahoo as of yesterday and we have redirected the old domain (at the domain level) to the new domain. However, we are having trouble getting the pages to redirect page for page. Currently they are all redirecting to the new domain home page. We did just move the old domain from GoDaddy to Yahoo yesterday thinking this would solve it however as of this morning the old pages are still redirecting to the home page of the new domain. To complete the 301 redirect picture, we uploaded the redirects (all relative links for both from and to) to BigCommerce. And while the domain was hosted at GoDaddy with a redirect to the new domain, they were working. We moved the domain to Yahoo because of email issues thinking it should still work. Is it possibly just a waiting game now as the change populates across the DNS? old url to test:
rock-n-roll-action-figures.com/fender-jazz-bass-miniature-guitar-replica-classic-red-finish.html0 -
.htaccess Redirect 301 issues
I have completely rewritten my web site, adding structure to the file directories. Subsequently added was Redirect information within the .htaccess file. The following example ...
Technical SEO | | Cyberace
Redirect 301 /armaflex.html http://www.just-insulation.com/002-brands/armaflex.html
Returns this response in the URL bar of ...
http://www.just-insulation.com/002-brands/armaflex.html?file=armaflex
I am at a loss to understand why the suffix "?file=armaflex" is added The following code is inserted at the top of the file ...
RewriteEngine On redirect html pages to the root domain RewriteRule ^index.html$ / [NC,R,L] Force www. prefix in URLs and redirect non-www to www RewriteCond %{http_host} ^just-insulation.com [NC]
RewriteRule ^(.*)$ http://www.just-insulation.com/ [R=301,NC] Any advice would be most welcome.0 -
Worth Changing Redirect From 302 to 301?
Hi, I'm doing an audit on a site that had a redesign in Dec 2009. For some reason I looked to see what kind of redirects were used from the old pages to the current ones, and it looks like they used 302s, which obviously isn't ideal. Given that it's been so long and those pages have looong since been de-indexed, is it worth me suggesting that they change those old redirects to 301s? My thinking is that if those old pages were linked to externally then I should recommend it, but I can't find any link info on Linkscape/OSE, Majestic SEO or YSE. Any comments appreciated.
Technical SEO | | The_Heavies0 -
301 redirects
Hi Guys, Question,
Technical SEO | | VividLime
Lets say I have a page oldfile.php at position #2 then set-up a redirection in the following way 100 incoming external links--> oldfile.php [301 to] newfile.php Google comes along and updates its index to newfile.php and ranking of newfile.php remains at position #2. Everything is good. Lets say in 5months, I come along and delete oldfile.php so we have
100 incoming external links--> deleted(oldfile.php) or 100 incoming external links-->404 error. |||| newfile.php Do I then loose the rankings on newfile.php. My thinking is that now that all the external links now point to a page not found, newfile.php should loose rankings Am I correct in my assumption?0 -
Wordpress 301 redirects
I use wordpress as CMS on a few sites and I noticed that word press automattically places 301s if I change a url etc. I believe it does it by having the following in the .htaccess file: BEGIN WordPress<ifmodule mod_rewrite.c="">RewriteEngine OnRewriteBase /RewriteRule ^index.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</ifmodule> END WordPress Should I use this? I feel like it limits my control over the 301s.
Technical SEO | | mmaes0