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
-
Old content with trailing `/` - What should be my new approach?
Dear team Moz, I'm investigating SEO issues for the site that dropped rankings over a period of 4-6 months; after conversion from old platform (xenForo) to new custom developed platform. The old version of the site was a simple xenForo based forum; with threads having standard url structure as like www.domain.com/threads/thread-title.{thread_id}/. Notice the trailing slash. We chose to keep the URLs intact during conversion to new platform; however the site still lost rankings. I'm sure there could be multiple reasons for it - but I wish to know if I should adjust the URLs - 1. By 301 redirecting all the URLs with trailing / to the URLs without /. 2. Leave the URLs as they were. I must also mention that the new site has several new sections; and the old forum is just one part of it. The rest of the site follows URLs without trailing / - as it's the recommended URL structure by Google. I'd really appreciate your suggestions on this.
Intermediate & Advanced SEO | | KaustubhKatdare0 -
Can I have multiple 301's when switching to https version
Hello, our programmer recently updated our http version website to https. Does it matter if we have TWO 301 redirects? Here is an example: http://www.colocationamerica.com/dedicated_servers/linux-dedicated.htm 301 https://www.colocationamerica.com/dedicated_servers/linux-dedicated.htm 301 https://www.colocationamerica.com/linux-dedicated-server We're getting pulled in two different directions. I read https://moz.com/blog/301-redirection-rules-for-seo and don't know if 2 301's suffice. Please let me know. Greatly appreciated!
Intermediate & Advanced SEO | | Shawn1240 -
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 -
Switching from HTTP to HTTPS: 301 redirect or keep both & rel canonical?
Hey Mozzers, I'll be moving several sites from HTTP to HTTPS in the coming weeks (same brand, multiple ccTLDs). We'll start on a low traffic site and test it for 2-4 weeks to see the impact before rolling out across all 8 sites. Ideally, I'd like to simply 301 redirect the HTTP version page to the HTTPS version of the page (to get that potential SEO rankings boost). However, I'm concerned about the potential drop in rankings, links and traffic. I'm thinking of alternative ways and so instead of the 301 redirect approach, I would keep both sites live and accessible, and then add rel canonical on the HTTPS pages to point towards HTTP so that Google keeps the current pages/ links/ indexed as they are today (in this case, HTTPS is more UX than for SEO). Has anyone tried the rel canonical approach, and if so, what were the results? Do you recommend it? Also, for those who have implemented HTTPS, how long did it take for Google to index those pages over the older HTTP pages?
Intermediate & Advanced SEO | | Steven_Macdonald0 -
Trailing Slashes for Magento CMS pages - 2 URLS - Duplicate content
Hello, Can anyone help me find a solution to Fixing and Creating Magento CMS pages to only use one URL and not two URLS? www.domain.com/testpage www.domain.com/testpage/ I found a previous article that applies to my issue, which is using htaccess to redirect request for pages in magento 301 redirect to slash URL from the non-slash URL. I dont understand the syntax fully in htaccess , but I used this code below. This code below fixed the CMS page redirection but caused issues on other pages, like all my categories and products with this error: "This webpage has a redirect loop ERR_TOO_MANY_REDIRECTS" Assuming you're running at domain root. Change to working directory if needed. RewriteBase / # www check If you're running in a subdirectory, then you'll need to add that in to the redirected url (http://www.mydomain.com/subdirectory/$1 RewriteCond %{HTTP_HOST} !^www. [NC]
Intermediate & Advanced SEO | | iamgreenminded
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L] Trailing slash check Don't fix direct file links RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.)/$
RewriteRule ^(.)$ $1/ [L,R=301] Finally, forward everything to your front-controller (index.php) RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [QSA,L]0 -
Our client's web property recently switched over to secure pages (https) however there non secure pages (http) are still being indexed in Google. Should we request in GWMT to have the non secure pages deindexed?
Our client recently switched over to https via new SSL. They have also implemented rel canonicals for most of their internal webpages (that point to the https). However many of their non secure webpages are still being indexed by Google. We have access to their GWMT for both the secure and non secure pages.
Intermediate & Advanced SEO | | RosemaryB
Should we just let Google figure out what to do with the non secure pages? We would like to setup 301 redirects from the old non secure pages to the new secure pages, but were not sure if this is going to happen. We thought about requesting in GWMT for Google to remove the non secure pages. However we felt this was pretty drastic. Any recommendations would be much appreciated.0 -
Switch from CCTLD to .com - Am I missing anything?
We currently have 14 international sites. (.co.uk, .fr, .es, .com.au, etc) and (language differences aside) the content is the same on all. I want to move this content from example.co.uk to example.com/uk/ (and from example.com.sg to example.com/sg/) to consolidate our domain authority, for brand consistency, and to reduce the overhead of maintaining 14 different domains. Our .com has by far the most domain authority (90) and often outcompetes newer smaller sites like .com.sg in local search) Other sites, however, (like .co.uk DA74) do quite well locally. My goal is to improve the performance of those sites with a low DA, without hurting the larger sites, and also to avoid the disappearance of local content in local search. e.g. currently when a user searches for "widgets" they find example.co.uk/widgets/ but in future I want them to find example.com/uk/widgets My plan is to redirect pages with 301 redirects, and use rel-alternate and hreflang metadata to manage indexing. So in the example above, I'd 301 example.co.uk/widgets to example.com/uk/widgets, then use the following metatag on that new page to suggest that it is the UK english version (for users in the UK) of a canonical page in the .com: (this is in accordance with the suggestion on this page http://support.google.com/webmasters/bin/answer.py?hl=en&answer=189077) My question is: Am I going to severely damage the ranking of, e.g., UK pages in UK search engines by doing this? Is there a better way to do this? Any input greatly appreciated. Thanks, Dennis
Intermediate & Advanced SEO | | dennis.globalsign0 -
Trailing Slash: Lost in Redirection?
Question here, but first the lead in. As you all know, 301 redirects don't pass on 100% of link juice. I've set up my site using htaccess to redirect all non-ww to www and redirect all URLs to have a trailing slash. FYI, the preferred domain is selected in WMT and canonical URLs appear in the head section of all pages. So now what happens when sites that link to mine don't include either the www or the trailing slash, which is actually quite common? Of course, asking the site own to correct the link is ideal, but that's not always possible. So if thousands of links on external sites are linking to http://www.site.com instead of http://www.site.com/, won't lots of link juice get lost in redirection? I can't think of anything more I can do to the URLs to reduce duplicate content and juice dilution. Thoughts? Kevin
Intermediate & Advanced SEO | | kwoolf0