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
-
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 -
Huge Search Traffic Drop After Switching to HTTPS - No Recovery After Couple of Months
Hi In November, we have switched our website (https://www.insidermonkey.com) from HTTP to HTTPS. Initially, we noticed slight search traffic loss but later discovered it might be due to HTTPS switch. A month later we added the https version at search console, and then saw an immediate huge drop (about 25-30%). We discovered the problem might be due to poor redirection and noticed our redirects were 302s instead of 301s. To fix the problem, we implemented the 301 redirects and submitted the sitemap containing links to the old site at the new search console property (https). We've gone through points listed on the page below: https://support.google.com/webmasters/answer/6073543 We fixed the redirects to 301 Double-checked the sitemaps Made sure we had a properly installed SSL certificate (Now, we get A+ from https://www.ssllabs.com/ssltest/analyze.html?d=www.insidermonkey.com) Made sure we have no mixed-content errors (we don't have any issues at search console.) We only avoided implementing HSTS, in case we might want to switch back to HTTP.
Intermediate & Advanced SEO | | etakgoz
We had a small improvement in the following month, but our traffic did not fully recover. We wanted to test for the possibility to switch back HTTP by switching only 2 articles in our CMS to HTTP. Our traffic got worse, not only for those but for the whole site. Then we switched back those 2 articles to HTTPS again and implemented HSTS. It seems our search traffic getting worse day by day with no sign of improving. In the link below you can find the screenshot of our weekly search traffic between 1 October - 1 March. We are down from 500K weekly visitors to mere 167K last week. https://drive.google.com/open?id=1Y1TQbj_YtGG4NhLORbEWbvITUkGKUa0G Any ideas or suggestions? We are willing to get professional help as well. What is the way to find a proper consultant for such problem with relevant experience?0 -
Keep ranking homepage for target keyword, or switch to another page?
Hi Moz Community! I've researched Moz to find the answer to this question but nothing for my situation. I'm hoping some experienced SEOs can help me out. Here's the situation: I'm up against some fairly stiff competition for my main keyword - the front page is dominated by major manufacturers with high brand recognition and loads of money, where as my client is a much smaller manufacturer trying to compete. However, their DA is only 37-53 so not impossible to outrank... just many links and a significant advantage. We've honed in on a keyword that still drives good traffic, that's a great term to drive paying customers, and that we can get competitive with. My strategy was to attempt to rank my client's _homepage _for this term, rather than a specific product page, as I knew that they'd have many more links and social shares of their main site. (I've been successful with this strategy before). We've risen 60+ positions for the keyword in the past 3 months, to position 12, but we seem to have plateaued for the past month. We're ranking in top 5 positions for a number of our other keywords, so I know we're trending well. However, I'm concerned that despite our quick rise to #12, I may have made a seemingly fatal decision to rank their homepage for our target keyword term. After we had plateaued for a while, I did a more thorough side by side comparison and found that 8 out of 10 competitors on the front page have 2 main things we don't (and can't, because we're ranking the homepage)... 1- The keyword in the url (they're ranking for product pages, i.e. homepage.com/keyword-here/) 2- Their keyword comes first, or early in the meta title. Ours is _supposed to _, but as you know- Google can do what it likes with your homepage title as it's your brand, so they've put our company name- _then _the keyword we added in the title. e.g. Our Company | The Term We're Ranking For We've done a lot of work, and gained many reputable, high quality links, and we did see a significant rank increase across all our pages. My question is- did I shoot myself in the foot? Or is ranking the homepage still viable in this situation? If ultimately this is going to be impossible to get in the top #5 spots, what can I do to fix it? We've already gained a PA of 38 on the homepage from our work. Or would you let it go and just keep working at it, expecting that eventually we'll break onto the front page? Thanks in advance! Let me know if you need more info. I tried to be general with terms/site for my client's sake.
Intermediate & Advanced SEO | | TheatreSolutionsInc0 -
Is something wrong with my index after https switch?
I have previously switched sites to https but this one is behaving a little different. On September 19th I switched to https. I did 301 redirects at the .htaccess, added it to search console, and since we are using Magento I changed the base url. In the past when I have done this the http site index just gradually drops while the https site gradually rises. In early October the http site started to slightly drop but since 10/23 there have been no changes. For the https site it started to increase up until 10/23 then stayed flat. Why have they stayed stuck like that for a month?
Intermediate & Advanced SEO | | Tylerj0 -
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 -
Should I switch all paid-for directory backlinks to nofollow backlinks?
Hello Mozzers, I'm looking at a niche party services directory (b2c), established for over 8 years. They're not using nofollow tags on backlinks from their paid entries (free entries only get phone numbers and not backlinks). If they suddenly switch all the paid-for backlinks in their directory to nofollow backlinks, might that have some kind of negative impact. Switching sounds like the best way forward, but I want to avoid any unintended consequences. Perhaps I should only implement this change gradually? Thanks in advance, Luke Edited 30 minutes ago by Luke Rowland
Intermediate & Advanced SEO | | McTaggart0 -
Should party services directory switch to nofollow links? What are the implications?
Hello Mozzers, I'm looking at a niche party services directory (b2c). However, they're not using nofollow tags on backlinks from their paid entries (free entries only get phone numbers and not backlinks). If they suddenly switch all the paid-for backlinks in their directory to nofollow, might that have some kind of negative impact. Switching sounds like the best way forward, but I want to avoid any unintended consequences. Thanks in advance, Luke
Intermediate & Advanced SEO | | McTaggart0 -
How do I get rel='canonical' to eliminate the trailing slash on my home page??
I have been searching high and low. Please help if you can, and thank you if you spend the time reading this. I think this issue may be affecting most pages. SUMMARY: I want to eliminate the trailing slash that is appended to my website. SPECIFIC ISSUE: I want www.threewaystoharems.com to showing up to users and search engines without the trailing slash but try as I might it shows up like www.threewaystoharems.com/ which is the canonical link. WHY? and I'm concerned my back-links to the link without the trailing slash will not be recognized but most people are going to backlink me without a trailing slash. I don't want to loose linkjuice from the people and the search engines not being in consensus about what my page address is. THINGS I"VE TRIED: (1) I've gone in my wordpress settings under permalinks and tried to specify no trailing slash. I can do this here but not for the home page. (2) I've tried using the SEO by yoast to set the canonical page. This would work if I had a static front page, but my front page is of blog posts and so there is no advanced page settings to set the canonical tag. (3) I'd like to just find the source code of the home page, but because it is CSS, I don't know where to find the reference. I have gone into the css files of my wordpress theme looking in header and index and everywhere else looking for a specification of what the canonical page is. I am not able to find it. I'm thinking it is actually specified in the .htaccess file. (4) Went into cpanel file manager looking for files that contain Canonical. I only found a file called canonical.php . the only thing that seemed like it was worth changing was changing line 139 from $redirect_url = home_url('/'); to $redirect_url = home_url(''); nothing happened. I'm thinking it is actually specified in the .htaccess file. (5) I have gone through the .htaccess file and put thes 4 lines at the top (didn't redirect or create the proper canonical link) and then at the bottom of the file (also didn't redirect or create the proper canonical link) : RewriteEngine on
Intermediate & Advanced SEO | | Dillman
RewriteCond %{HTTP_HOST} ^([a-z.]+)?threewaystoharems.com$ [NC]
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule .? http://www.%1threewaystoharems.com%{REQUEST_URI} [R=301,L] Please help friends.0