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
-
The problem you're describing is almost exactly the reason why canonical URL functionality exists. Just pick your canonical (with or without slash - it doesn't matter) and make sure you roll it out consistently across your website and sitemap.
Regards,
George
-
I would personally suggest you not to go for 301 as it will increase the page load time of the website which direct affects the rankings in search engines. I would rather prefer to choose the preferred version and use canonicals on every page of the website. This way Google will have an idea about what URL is the preferred and crawl the stuff accordingly.
Hope this helps!
-
Hi,
I would suggest that you verify whether 301 redirects are even a possibility. For example, if the website is hosted on IIS server, then the 301 redirect rule might result into a redirect loop. In such a scenario, I would suggest you place self canonical tag on the page. For example on the page domainA.com/page 1, we will have the following tag in the head section of the page -
For the PDF files, place the canonical tag in the header response.
On the links front - You will not be losing a lot
Regards,
Sajeet
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
-
Submitting URLs After New Search Console
Hi Everyone I wanted to see how people submit their urls to Google and ensure they are all being indexed. I currently have an ecommerce site with 18,000 products. I have sitemaps setup, but noticed that the various product pages haven't started ranking yet. If I submit the individual url through the new Google Search Console I see the page ranking in a matter of minutes. Before the new Google Search Console you could just ask Google to Fetch/Render an XML sitemap and ask it to crawl all the links. I don't see the same functionality working today on Google Search Console and was wondering if there are any new techniques people could share. Thanks,
Intermediate & Advanced SEO | | abiondo
Anthony1 -
When I crawl my website I have urls with (#!162738372878) at the end of my urls
When I crawl my website I have urls with (#!162738372878) at the end of my urls. I used screaming frog to look check my website and I seen these. My normal urls are in there too, but each of them have a copy with this strange symbol and number at the end. I used a website builder called homestead to make the website and I seen a bunch of there urls in my crawl as well - http://editor.homestead.com/faq is an example I recently created a new website with their new website builder and transferred it to my old domain. However, I didnt know they didnt offer 301 redirects or canonical tags(learned about those afterwards) and I changed my page names. So they recommended I leave the old website published along with the new website. So if I search my website name on google, sometimes both will show in the results. I just want to sort this all out somehow. My website is www.coastlinetvinstalls.com Any feedback is greatly appreciated. Thanks, Matt
Intermediate & Advanced SEO | | Matt160 -
Does having active urls with and without trailing .html impact SEO?
A recent update resulted in duplication of urls on our site due to inconsistent url structure: Example: /category2.html and /category2 both active on the site as the same page Will this hurt and should we create redirects using only one version of the url? /category2.html redirect to /category2
Intermediate & Advanced SEO | | Karri_Parks0 -
When the site's entire URL structure changed, should we update the inbound links built pointing to the old URLs?
We're changing our website's URL structures, this means all our site URLs will be changed. After this is done, do we need to update the old inbound external links to point to the new URLs? Yes the old URLs will be 301 redirected to the new URLs too. Many thanks!
Intermediate & Advanced SEO | | Jade1 -
HTML for URL markup
Hi, We are changing our URLs to be more SEO friendly. Is there any negative impact or pitfall of using <base> HTML-tag? Our developers are considering it as a possible solution for relative URLs inside HTML-markup in the Friendly URL context.
Intermediate & Advanced SEO | | theLotter0 -
Canonical url question
i just search seomoz tooll it say duplicate content for www.mysite.com and www.mysite.com/index.php should i use canonical url for this ? is yes then is this right ?
Intermediate & Advanced SEO | | constructionhelpline0 -
How does authorship work for two authors?
How does Google's version of authorship work for 2 authors?: support.google.com/webmasters/bin/answer.py?hl=en&answer=1408986 https://plus.google.com/authorship
Intermediate & Advanced SEO | | BobGW0 -
URL formating is it worth changing?
One of my clients sites has almost OK URL's, set up something like the following: keyword2_keyword3_keyword1 Ideally the URL's would be more like this: keyword1-keyword2-keyword3 My question is is there any point in changing them and 301 redirecting them over just to get the target keywords in a better order and change the _ to a - ? Has anyone tried this and its worked or not worked, I don't want to throw the baby out with the bath water. Justin
Intermediate & Advanced SEO | | GrouchyKids0