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
-
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 -
Penguin 2.1\. Bad links removed - do I need to wait for next Penguin upgrade to see recovery?
Hi - I have read conflicting advice about this issue - after taking action and removing bad links following a Penguin 2.1 hit, will the site need to wait for the next Penguin upgrade before the link clean-up has any effect? Or will the cleaning of the links be acknowledged and "rewarded" with a ranking improvement before that (assuming all bad links were cleared out)?
Intermediate & Advanced SEO | | StevieD0 -
Fastest Way To Remove Footer Link? (post-Panda)
Hello, I have a website with 1k+ links pointed directly to an inner page and home page from blogspot domains. There are 3 links in the footer that points to different locations. 1st anchor text points to the person who designed the page template and links to their website (this doesn't affect us) 2nd anchor text uses a direct keyword that I am trying to rank for and links to the inner page. 3rd anchor text uses my website name and links to the home page I know that these are not good links and the content inside the pages are irrelevant to my own website. The links are embedded into the template on the footer and is site wide.I have already contacted the designer and have the links removed but those that have downloaded the templates still have the footer link. What would be the best way to remove all these footer links? Trying to contact each individual person who is using the template is not working out as most have not responded and some of the websites have not seen an update in years! Any thoughts? If you need additional information feel free to send me a direct message so I can send you an exact link.
Intermediate & Advanced SEO | | Shawn1240 -
Forced Trailing Slash on PHP Pages In Google!
Hi, have never seen this before so am hoping soemone can shed some light! Google seems to be forcing a trailing slash at the end of our php pages within the search results. For example, Google is indexing http://www.kingstoncabinets.co.uk/heat-convection.php/ (trailing slash) rather than http://www.kingstoncabinets.co.uk/heat-convection.php (without slash). The trailing slash page doesn't display properly and has no page authority. I've ran the site through Screaming Frog and there are no internal links the the trailing slash URL's, nor does there seem to be any external links to these pages. Why is Google forcing the slash? Am confused 😞
Intermediate & Advanced SEO | | Webpresence0 -
Should I remove the ?replytocom variables in wordpress?
I'm using Yoast's wordpress plugin and there is an option to remove the replytocom variables. I'm curious what everyone's thoughts were on that, and if I should do it. Here's the site if you need to see it. Thanks!
Intermediate & Advanced SEO | | NoahsDad0 -
Asking Sites to Remove Links.. What should I say?
After getting some guidance from you guys here on this forum i have decided to go through my WMT backlinks and contact all the sites that I think are spammy and are linking back to me....and I will ask them to remove my links from their sites... Can you guys please provide some guidance as to what I should say in the letter (also, anything i should definitely not say).... Thanks for the help...
Intermediate & Advanced SEO | | Prime850 -
Removing pages from index
Hello, I run an e-commerce website. I just realized that Google has "pagination" pages in the index which should not be there. In fact, I have no idea how they got there. For example, www.mydomain.com/category-name.asp?page=3434532
Intermediate & Advanced SEO | | AlexGop
There are hundreds of these pages in the index. There are no links to these pages on the website, so I am assuming someone is trying to ruin my rankings by linking to the pages that do not exist. The page content displays category information with no products. I realize that its a flaw in design, and I am working on fixing it (301 none existent pages). Meanwhile, I am not sure if I should request removal of these pages. If so, what is the best way to request bulk removal. Also, should I 301, 404 or 410 these pages? Any help would be appreciated. Thanks, Alex0