Removing the Trailing Slash in Magento
-
Hi guys,
We have noticed trailing slash vs non-trailing slash duplication on one of our sites.
Example:
Duplicate: https://www.example.com.au/living/
Preferred: https://www.example.com.au/livingSo, SEO-wise, we suggested placing a canonical tag on all trailing slash pointing to non-trailing slash.
However, devs have advised against removing the trailing slash from some URLs with a blanket rule, as this may break functionality in Magento that depends on the trailing slash. The full site would need to be tested after implementing a blanket rewrite rule.
Is any other way to address this trailing slash duplication issue without breaking anything in Magento?
Keen to hear from you guys.
Cheers,
-
You could always force trailing slashes instead of removing all trailing slashes.
What you really want to establish, is which structure has been linked to more often (internally and externally). A 301 redirect, even a deeper more complex rule - is seldom the answer in isolation. What are you going to do (for example) when you implement this, then you realise most of the internal links use the opposite structure to the one which you picked, and then all your internal redirects get pushed through 301s and your page-speed scores go down?
What you have to do is crawl the site now, in advance - and work out the internal structure. Spend a lot of time on it, days if you have to, get to grips with the nuts and bolts of it. Figure out which structure most internal/external links utilise and then support it
Likely you will need a more complex rule than 'force all' or 'strip all' trailing slashes. It may be the case that most pages contain child URLs or sub-pages, so you decide to force the railing slash (as traditionally that denotes further layers underneath). But then you'll realise you have embedded images in some pages with URLs ending in ".jpg" or ".png". With those, they're files (hence the file extension at the end of the URL) so with those you'd usually want to strip the slash instead of forcing it
At that point you'd have to write something that said, force trailing slash unless the URL ends with a file extension, in which case always remove the slash (or similar)
Picking the right structural format for any site usually takes a while and involves quite a bit of research. It's a variable answer, depending upon the build of the site in question - and how it has been linked to externally, from across the web
I certainly think, that too many people use the canonical tag as a 'cop out' for not creating a unified, strong, powerful on-site architecture. I would say do stick with the 301s and consolidate your site architecture, but do some crawling and backlink audits - really do it properly, instead of just taking someone's 'one-liner' answer online. Here at Moz Q&A, there are a lot of people who really know their stuff! But there's no substitute for your own research and data
If you're aiming for a specific architecture and have been told it could break the site, ask why. Try and get exceptions worked into your recommendations which flip the opposite way - i.e: "always strip the trailing slash, except in X situation where it would break the site. In X situation always force the trailing slash instead"
Your ultimate aim is to make each page accessible from just one URL (except where parameters come into play, that's another kettle of fish to be handled separately). You don't have to have EVERYTHING on the site one way or the other in 'absolute' terms. If some URLs have to force trailing slash whilst others remove it, fine. The point is to get them all locked down to one accessible format, but you can have varied controlled architectures inside of one website
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
-
URL structure with dash or slash
Hi, everyone Basically I am editing my website page's URL for SEO Optimisation and I am not sure which URL structure is best for SEO. The main different is the sign ( dash or slash ) before the product-code. HERE ARE TWO EXAMPLE www.example.com/long-tail-keyword-product-code www.example.com/long-tail-keyword/product-code To get more idea of my page, here is one of the product from my website : http://www.okeus.co.uk/pro_view-3.html My website is selling my own product, as a result the only keyword can be found was the name of the product and I separated different design by different code. Any experts who are willing help would be very much appreciated.
Intermediate & Advanced SEO | | chrisyu781 -
Htaccess or url rewrite module for Magento 301 redirects?
I need to do about 6000 redirects for a Magento site. The pages no longer exist. I have tried the URL rewrite module but it isn't working for me and I don't want to do 6000 redirects in the htaccess files. Any suggestions?
Intermediate & Advanced SEO | | Tylerj0 -
Very Slow Recovery after Manual Penalty Removed - Are we missing something?
Our site was handed a manual penalty in November 2013 where exact match anchor text and low quality directory submissions seemed to be the problem. We began the process of link removal, reconfiguration and disavowing. We had already planned to change our domain in early 2014 to coincide with our SSL certificate renewal and although we were hesitant to do this with the manual penalty still there we proceeded and 301'd most of the site but left the pages that were the landing page for most of the exact match links as 302 to the new domain. We continued to work on removing the manual penalty for the old domain as we didn't want it to pass over to the new one and eventually this was removed n March 2014 Now the penalty is gone are we safe to change those 302 redirects to 301 so everything redirects. The problem we have is that six months on, a lot of the pages for the old domain are still indexed and even though we are indexed for the new domains are rankings haven't recovered. Is it just a case of needing to build up a new quality link profile to replace the links that were disregarded or removed when recovering from the penalty or we missing something else
Intermediate & Advanced SEO | | Ham19790 -
Xml sitemap only shows up sometimes (magento)
Hi Moz community, I'm using Magento platform. I can generate a sitemap using their xml generator, but it will only pull up sometimes in web explorers, the rest of the time it will show a 404 page. GWT also tells me that I get a 404 error when testing the sitemap, but sometimes it will acknowledge that it's there. Anyone had this problem before or know how to help. sitemap= www.ice.com/sitemap.xml Let me know what other information I can provide to help. Thanks!
Intermediate & Advanced SEO | | IceIcebaby0 -
Is it worth removing date from Blog Posts / Articles
Wondering, is it worth to remove date from articles from seo perspective. Am sure, Google search algorithm would like demote a post written a year back, as against an article on the same post (unless a year old post has very strong Authoritative links) May be it can turn out a bad user experience of removing dates, but if can hide date using Javascripts so as to show it as image to user and hide it from search engines, is it a good idea !!
Intermediate & Advanced SEO | | Modi0 -
Sitelink Removal Timeframe
Hi Everyone, Has anyone had experience using the sitelinks demotion tool within GWT after a site redesign? How long does it take for the demotion to go into effect? We just went live with a new version of a site for one of our clients, and the generated sitelinks are no longer valid. I have demoted the urls associated with the old sitelinks, and it's been over a week with no change. Does anyone have experience in a similar situation? Also, for anyone looking for a time frame on changes to a meta description, after resubmitting an updated sitemap, it took 2 days for Google to display an updated meta description. Please advise, Chris Wilson
Intermediate & Advanced SEO | | Chris_CM0 -
Should I Remove Dates From My Old Posts
I have a web site that has content about home improvement topics but the site has no new content since 2010. All the posts on the wordpress site have the date which are all 2010 and prior. Is there a downside in terms of search engine rankings to remove the dates or changing the dates? What are the risks to removing the dates? Could I lose rankings if I do this? Do you have any personal experience with this situation?
Intermediate & Advanced SEO | | alpha170 -
Magento Duplicate Content Recovery
Hi, we switched platforms to Magento last year. Since then our SERPS rankings have declined considerably (no sudden drop on any Panda/Penguin date lines). After investigating, it appeared we neglected to No index, follow all our filter pages and our total indexed pages rose sevenfold in a matter of weeks. We have since fixed the no index issue and the pages indexed are now below what we had pre switch to Magento. We've seen some positive results in the last week. Any ideas when/if our rankings will return? Thanks!
Intermediate & Advanced SEO | | Jonnygeeuk0