Trailing slash at end of URLs?
-
Hi, I'm just about to put up a new site and I need to decide between having no trailing slash at the end of the all the URLs, or putting one in there.
I think Matt Cutts has a slight preference for them, as stated here: http://www.seomoz.org/blog/whiteboard-interview-googles-matt-cutts-on-redirects-trust-more
"Matt says he would slightly advocate for using a trailing slash simply because it clearly indicates that a URL is a folder and not a document."
However, I'm really wondering. I mean, if people link to my site, they'll tend not to insert a trailing slash, I'm thinking...
Your thoughts would be welcome on this one!
Cheers, Luke
-
Gosh some really great input here. Would the server ever write a redirect - I suppose if the htaccess told it to do so ...? I have a few pages on my site that were first changed to include the / then changed back to without the / then changed back again. This actually caused some loss of page authority. What can I do to at least stop this madness and unnecessary redirect writes on my server.
-
Hi Guys,
Just as Jon-S, I'm curious about any updates on this item. Does someone have experienced SEO benefits by using or not using a trailing slash at the end of their URLs?
Any news would be more than welcome!
Regards,
Jens -
Hey All,
Popping my Moz cherry with this post!....Should I include the trailing slash or not?
I know this thread is a little old now but is it still relevant? I'm guessing not, seen as Moz themselves have dropped the trailing slash for this site, check out this posts URL; https://moz.com/community/q/trailing-slash-at-end-of-url
Any advice would be great as I'm just about to start on a new site and I'm really trying to nail down all the technical stuff.
-
I've just found this after some searching on Google and (I know its from 2009) but some of the points in the article seem logical. Out the box WordPress (for instance) will add a forward-slash at the end of the URL and I know a few other CMS's do this as well.
One thing I would say is that if you're working on a back-linking campaign (which I fully recommend investing some time in doing btw) then you would want to link to the URL with the end forward slash in the URL, even for the homepage (http://www.domain.com/). If memory serves me right if you access your page with the forward-slash on the end the web server knows your linking to a folder and not a file so it does one less lookup when serving up the page (making the initial request a little bit quicker).
http://www.searchenginejournal.com/linking-issues-why-a-trailing-slash-in-the-url-does-matter/13021/
-
Hi Luke,
Glad you appreciated the above .htaccess rules, hopefully that will help.
I think file extensions should only be used for anything that isn't .php, .asp, .html etc.
If nothing else it gives you the freedom to change the underlying technology of the site without having to change all the indexed pages in Google using a 301 redirect.
For instance, if I had: www.domain.com/page1.html then it would be better to have this as www.domain.com/page1/
If I had a file it would be best to keep that as: www.domain.com/files/myfile.pdf without the forward-slash at the end.
-
Thanks Ben, O&M, Alex and MHM
(hey Ben, that info's really useful btw! - thanks again!)
One thing I didn't understand O&M is: "One thing you shouldn’t include a slash is after a file name in the URL" - do they mean file name extensions I wonder. I took a look over at Matt Cutts's website and he'd bunged in a trailing slash on all his pages (I think - all the ones I looked at anyway).
-
Since most people leave them off, and most people link that way and it's easyer to set up I have site wide slash removals.
You get a 301 regardless if people link to you wrongly, so be carful when giving out the url and internal linking you use the right on either way.
I'm also not convinced that the article quoted is right in saying that the server does a 301 when you leave it off. It certainly has to do an extra lookup stage to find the right file(look for file, not find, look for directory with defualt document), but theres no 301 header returned.
-
It doesn't matter which you choose too much, as long as you're consistent across the website.
I'd go without a stroke; people are more likely to link to you without typing the stroke (as you say), so I think you'll retain slightly more link juice to the chosen URL if you don't include it (saving a 301 redirect from the '/' version). And personally I think a URL looks neater minus the '/'. The speeds "Optimize and Monetize" quotes are minuscule.
-
Slash all the way......read this article below that explains why it makes sense to do it. She does a better job than I would..... Authors name is Jennifer Kyrnin. Cutts and Kyrnin are in. make it happen.
Traditionally, URLs that pointed to files did not include the trailing slash, while URLs that pointed to directories do include the trailing slash. This means that:
http://webdesign.about.com/example/
is a directory, while
http://webdesign.about.com/example
is a fileThis helps speed up page loading because the trailing slash immediately tells the web server to go to that
example/
directory and look for the[index.html](http://webdesign.about.com/od/beginningtutorials/f/index_html.htm)
or other default file.When you go to a URL without the trailing slash, theweb server looks for a file with that name. If it doesn’t find a file with that name, then it looks for a directory and looks for the default file in that directory.
Leaving Off the Slash Results in a Redirect – Redirects Slow Down Web Pages
When you leave off the slash on a URL that is pointing to a directory, you are forcing the server to do a 301 Redirect - HTTP Redirects - 301 Redirect Better than Meta Refreshredirect. While it may seem instantaneous to you, it does take slightly longer for a page to load from a redirect than from the direct URL. And every little bit adds up.
Don’t Include the Slash After Filenames
The only time you shouldn’t include a slash is after a file name in the URL. For example:
Type:
http://webdesign.about.com/example.html
Not:
http://webdesign.about.com/example.html/
If you add the slash, the web server will look for a directory named
example.html
, and most servers do not then try to find a file name of that name. So your customers would get a 404 error in that situation.Always Include the Slash When Linking to Your Domain with No File Name
You can speed up access to your home page by including the trailing slash on your domain name URL. For example:
http://webdesign.about.com_/_
While you can’t control what your readers type into their location bar for your URL, you can control what you link them to. Always include the trailing slash in your URL links. If you include it in your marketing materials as well, you can help keep your pages loading quickly for your readers, as most people type whatever is printed without adding or removing characters.
Article link is here....http://webdesign.about.com/od/beginningtutorials/f/why-urls-end-in-slash.htm
-
You could always force a trailing slash using .htaccess even if someone visits the page without the end slash. Something like this might work, if it doesn't, let me know and I'll get something working for you.
<code>RewriteEngine On # 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] 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]</code>
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
-
Dark Traffic & Long URLs - Clarification
Hi everyone, I've been reading the 2017 report by Groupon and the 2017 article by Neil Patel r.e. dark traffic. Both of these articles work on the assumption that most long URLs are not direct traffic because people wouldn't type a long URL into their browser. However, what happens to me personally all the time is that I start typing a URL into the browser, and the browser brings up a list of pages I've visited recently, and I click on some super long URL that I didn't bookmark but have visited in the past. That is legitimate direct traffic, but it's a long URL. I'm just wondering if there's something flawed in my reasoning or in the reasoning of Patel and Groupon. Maybe most people aren't relying on browsers like I am, or maybe things have changed a lot in the past 3 years. What do you think? And are there any more recent resources/articles that you would recommend r.e. trying to parse out dark traffic? https://neilpatel.com/blog/dark-traffic-stealing-data/ Thanks!
Search Behavior | | LivDetrick0 -
MozPoints end of year 2015, top 50 aggregated
On December 30th, 2015 I decided to look at the Moz Community Rankings, I find it fun to do for time to time, and I always like to see how close I am to getting that special dinner with Rand I have heard so much about in the past. One thing I noticed right away is that Moz ranks members just on MozPoints, and not on other factors like, how helpful they tend to be. This means had I joined in a few years earlier, I could be at the top.. or could I be??? Again, it is just something I did for fun, but I decided to look at a few additional factors to get my True MozRank 🙂 By examining just the top 50 active members I added some additional ranking factors and aggregated them to find a true Rank. The ranking factors are.. Moz Points Per Month (Using the users points divided by months they have been a member) Thumbs Up percentage (Using the percentage of Thumbs Up they receive per point) Good Answer percentage (Using the percentage of Good Answers they receive per point) Endorsed Answer percentage (Using the percentage of Endorsed Answers they receive per point) After that I gave each of the top 50 a rank in each category based on their respective scores. I then totaled the ranks, and assigned a new final rank based on the lowest totals (which means they ranked the best).
Search Behavior | | donford
Edit (01/18/2016): With the help of Peter Nikolow I aggregated all active users as per this post.
Link to all 4291 active users ranks For example EGOL category ranks: MozPoint Rank (1) Points Per Month Rank (2) Percent of Thumbs Up Rank (27) Percent of Good Answers Rank (29) Percent of Endorsed Answers Rank (23) Total = 82
Final Rank = 5 His closest competitor RyanKent MozPoint Points rank 2 MozPoint Rank (2) Points Per Month Rank (3) Percent of Thumbs Up Rank (39) Percent of Good Answers Rank (9) Percent of Endorsed Answers Rank (20) Total = 73
Final Rank = 2 Well it was a fun experiment for me, a couple people are out of place in the rankings based on other factors but for the most part MozPoints are pretty accurate. You can view the spread sheet on Google Docs and play around with the data as you wish. Don EDIT: After looking at the document again I noticed an error with rank assignments I have since fixed it. Edit (01/18/2016): With the help of Peter Nikolow I aggregated all active users as per this post. Link to all 4291 active users ranks13 -
Is there a tool that will find a string from the source code from a list of URLs?
I need a tool that will run through a long list of URLs (from multiple domains), look for a specific string in the source code and then produce a CSV showing in which URLs the the string was found. This is for legitimate research, not for any nefarious purposes Any ideas of such a tool already exists?
Search Behavior | | richdan0 -
Direct 100+ URLs to our sister site?
Hi, We have two websites www.eurekasolutions.co.uk and www.eurekaaddons.co.uk - currently the eurekasolutions site has eureka addon products on it - we are thinking of re-directing these to www.eurekaaddons.co.uk instead (there are 100+ pages which are being ranked and picked up by google) Would it be foolish to re-direct these from eurekasolutions straight to eurekaaddons after them being on eurekasolutions for many many years? if so what is the best way to go about it and would this have a direct negative effect on our SEO? Both sites are serving for similar terms. Thanks,
Search Behavior | | EurekaSolutions0 -
Disallow robots on a url effect?
Hello, I am using wordpress and on some of my top tag urls e.g : http://www.designzzz.com/tag/brushes/ there is an avg page rank of 4. I was reading somewhere that my huge jump in not selected count in index status in GWT is becuase of tags/categories urls. So i added disallow in my robots.txt for the url /tag What sort of effect will it have on my tag urls rankings or PR ?
Search Behavior | | wickedsunny10 -
Would it be worthwhile to update URLs to include "for sale"
My team is new to the world of SEO. We were both in other departments when our last "expert" left and we became the entire department. Needless to say, we have many questions. I have a site for an existing customer - she wants to know if it is a good idea to change her URLs. She went to a webinar that suggested she include "for sale" in URL, since that is the site's primary purpose These are the current inventory URLs: http://www.dealerskinssite.com/used-inventory http://www.dealerskinssite.com/new-inventory The change would give something like: http://www.dealerskinssite.com/used-cars-for-sale
Search Behavior | | DealerskinsSearch
http://www.dealerskinssite.com/new-cars-for-sale I did some searching and could not find a solid recommendation one way or another. If it is true that people typically search for "used cars for sale" rather than a "used inventory", then there might be benefit to including that as part of the URL... but that is as far as my knowledge got me. Please let me know your thoughts Steve0 -
Two sites with different URLs
I help organize an ecommerce site for a company that is named after the state that the company was founded in (ex: Florida Pipes). Our programmer is thinking about creating a duplicate site that would have a name that was more location agnostic so people shopping on the site would not think that they may be ordering from far away hence incurring extra shipping charges. He said that the site would only have a different URLs, name and homepage but would link to all of the same stuff that is on the site that is up now. He said that there would be no way to tell (possibly for the layperson) that the two sites were related. Is this a good practice? Would we be penalized in search results for having two URLs linking to the same content? (We are a 30 year old company that ranks very high for our main keyword) Thank you for your input!
Search Behavior | | Winoman0 -
Where can I find research into consumer behavior in URL input?
I have a hypothesis that the % of users that type URLs is decreasing. Instead I think users will be arriving at sites by clicking on links in emails, search and social. Where can I find data / research to back me up?
Search Behavior | | TomCritchlow0