Should I switch from trailing slash to no trailing slash?
-
I have a website which has had trailing slashes added to the URLs by 301 redirects for over 3 years. However, the custom CMS does not allow navigation links to have trailing slashes. This is resulting in 301s every time a user clicks a navigation link.
The site ranks fairy well for some moderately competitive keywords.
If you were in my shoes, would you remove the forced trailing slash redirect in the .htaccess and replace it with a trailing slash removal redirect, or would you leave it like it is?
Thanks,
Jamesp.s. the CMS also doesn't allow canonicals.
-
I'd absolutely agree. If you can get it fixed properly in a couple of months, then leaving the status quo would e better than making interim changes that just trade one set of redirects for another.
P.
-
Hi Paul, that would be the ideal fix. Unfortunately, it won't be an option for at least a couple of months. Maybe best just to wait then.
-
Honestly? I'd spend the time to get the Custom CMS fixed to allow trailing slashes in the navigation links. That would eliminate the redirect issue, Instead of just trading it off to another set of links that would have to redirect.
It sounds like a code sanitising issue in the CMS. Worth spending a couple of hundred dollars to fix the root cause of the issue instead of spending that money to apply bandaids that cause other problems elsewhere. (And bonus, maybe you can get proper canonicalisation built at the same time.)
Of course, yea, this does depend on having/finding a competent developer and having a test environment that doesn't endanger the live site.
Any chance you could push for this option?
Paul
-
Hi James
The reality is that it doesn't matter whether there is a trailing slash or not at the end of your URLs. What is important is that only one version is used and preferably there is no 301 from one to the other if it can be avoided. Especially if there are live links going to one or the other on the front end of your website.
So in your case you have navigation links with no trailing slash and a forced 301 adding them on.
I would remove the htaccess code which is forcing everything to a trailing slash and then add a piece of code removing it from any inbound requests.
Clearly, all backlinks will include the slash including Google - adding the code will resolve these pretty quickly and your existing search results will flick over when they are next crawled. This will depend on the size of your website and the crawl rate. You can check this in webmasters.
Remember that if you do this the backlinks from other websites will have a trailing slash and when the hits come in the new 301 will take them to a non-trailing slash. There may be a small drop in link juice from these backlinks. (I say 'maybe' as Rand Fishkin still believes so - others swear blind there isn't) so be prepared.
You have to balance this small backlink problem with actively pointing to URLs that 301s that redirect. Any SEO will tell you that this is not good! Presumably, the sitemaps don't have trailing slashes? So your site says one thing and your sitemaps another - a nightmare.
This is a version of the code to be placed at the top:
RewriteEngine On
RewriteCond%{REQUEST_FILENAME}!-d
RewriteRule^(.*)/$ /$1 [L,R]# <- for test, for prod use [L,R=301]I hope that helps
Regards
Nigel
-
Hi James,
Really sorry to hear about your problem, this kind of situation can be a real pain in the neck. If I were you, I would look for a better CMS which gives me a freedom to do a better SEO. If you still wish to continue with this CMS, you should map 301 the URLs for trailing slashes to their working locations.
I hope this helps.
Regards,
Vijay
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
-
How bad is a trailing slash?
I am working in Magento 2 which has all sorts of difficulties. My product page is example.com/testproduct the canonical is the same. But in the sitemap it is example.com/testproduct/ In a perfect world I would get rid of the trailing slash but can't because of this issue- https://magento.stackexchange.com/questions/205337/unique-constraint-violation-found-when-remove-suffix-html-magento-2-2-0 The trailing slash will 301 redirect properly. Is it an issue having the sitemap urls different with the trailing slash?
Intermediate & Advanced SEO | | Tylerj0 -
Should you automatically resolve URLs with extra trailing slashes added by accident?
Hi - I was just wondering whether a URL with extra trailing slashes should actuall redirect to the version without the extra trailing slashes... e.g. www.domainname.com/folder////// should automatically resolve to www.domainname.com/folder/ - what is your opinion on this?
Intermediate & Advanced SEO | | McTaggart0 -
SEO penalty for changing domains by simply switching DNS on Wordpress and adding 301s server-side?
Working on a domain change for a client. They're hosted on Wordpress and their developer wants to simply switch out the DNS for the new domain to point to wordpress, and then have the old domain use 301s to redirect to the new domain. The url structure will be the same, but there will be no CMS connected to the old domain after the switch. Is this dangerous for SEO? A significant portion of their customers are from organic traffic and losing SEO value would be very bad.
Intermediate & Advanced SEO | | dfolwell0 -
Bingpreview/1.0b Useragent Using Adding Trailing Slash to all URLs
The Bingpreview crawler, which I think exists in order to take snapshots of mobile friendly pages, crawled my pages last night for the first time. However, it is adding a trailing slash to the end of each of my dynamic pages. The result is my program is giving the wrong page--my program is not expecting a trailing slash at the end of the urls. It was 160 pages, but I have thousands of pages it could do this to. I could try doing a mod rewrite but that seems like it should be unnecessary. ALL the other crawlers are crawling the proper urls. None of my hyperlinks have the slash on the end. I have written to Bing to tell them of the problem. Is anyone else having this issue? Any other suggestions for what to do? The user agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53 BingPreview/1.0b
Intermediate & Advanced SEO | | friendoffood0 -
Is it better to have trailing slash or no trailing slash in URLs and what if both variations work?
Hi I have a situation on a website where the links are structured like this http://website.com/myurl/ so anywhere you click you will land on a page with a trailing slash but if i remove the trailing slash like this http://website.com/myurl the page is still going to open the same content. 1. so it works with and without the trailing slash. is this considered as duplicate content by google? and if so what is the best way to go? should i redirect al the non trailing slash urls to trailing slash or the opposite? 2. if i redirect am i going to loose some link juice from existing external links which mainly already point to urls without th trailing slash. 3. i've noticed that the sitemap.xml contains links without the trailing slash .. should it contain the urls with the trailing slash? Also there's many external links pointing to this site but withouth the trailng slash like this http://website.com/myurl
Intermediate & Advanced SEO | | urkeman0 -
Magento Trailing Slash URL Problem
Howdy Mozzers! Our magento store URL's are accessible with or without a trailing slash at the end. Canonical's and 301 redirects are not set up for one of them at the moment. Will this cause duplicate issue? Do we need to set canonical or 301 up? Which one is recommended? MozAddict
Intermediate & Advanced SEO | | MozAddict0 -
Content Transfer for Penguin Induced Domain Switch
One of my customers has a mature site that performs very well in ranking and traffic for major keywords, prosun.com. A few years ago we started welproma.com because they were changing their name and branding. We built up welproma.com as an eventual replacement and ramped up to 30% of the Prosun.com traffic. Penguin hit a bit in 2012 but very bad May 24, 2013 and it keeps getting worse. Now they are backing out of the name change, reverting back to prosun.com as the main website. Unfortunately the Welproma.com content is far better in quantity and quality so we would prefer not to waste it. Does anyone think it is a problem to take essentially the exact content from the newer, penalized site and move it to the older well performing site. We will use no links whatsoever between the two sites and take down the new one once we switch.
Intermediate & Advanced SEO | | phogan0 -
Trailing slash and rel="canonical"
Our website is in a directory format: http://www.website.com/website.asp Our homepage display URL is http://www.website.com which currently matches our to eliminate the possibility of duplicate content. However, I noticed that in the SERPs, google displays the homepage with a trailing slash http://www.website.com/ My question: should I change the rel="canonical" to have a trailing slash? I noticed one of our competitors uses the trailing slash in their rel="canonical" Do potential benefits outweigh the risks? I can PM further information if necessary. Thanks for the assistance in advance...
Intermediate & Advanced SEO | | BethA0