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
-
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 -
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 -
Google Webmaster Remove URL Tool
Hi All, To keep this example simple.
Intermediate & Advanced SEO | | Mark_Ch
You have a home page. The home page links to 4 pages (P1, P2, P3, P4). ** Home page**
P1 P2 P3 P4 You now use Google Webmaster removal tool to remove P4 webpage and cache instance. 24 hours later you check and see P4 has completely disappeared. You now remove the link from the home page pointing to P4. My Question
Does Google now see only pages P1, P2 & P3 and therefore allocate link juice at a rate of 33.33% each. Regards Mark0 -
URL Parameters Duplicate Page Title
Thanks in advance, I'm getting duplicate page titles because seomoz keeps crawling through my url parameters. I added forcefiltersupdate to the URL parameters in webmaster tools but it has not seemed to have an effect. Below is an example of the duplicate content issue that I am having. http://qlineshop.com/OC/index.php?route=product/category&path=59_62&forcefiltersupdate=true&checkedfilters[]=a.13.13.387baf0199e7c9cc944fae94e96448fa Any thoughts? Thanks again. -Patrick
Intermediate & Advanced SEO | | bamron0 -
How important is it to canonicalize mobile URLs to desktop URLs?
I know many SEO's prefer a stylesheet and single URL, but if you use m.domain.com, do you canonicalize to your desktop URLS?
Intermediate & Advanced SEO | | nicole.healthline0 -
URL Parking and Frame Forwarding..
I have a few URLs... Is there any benefit for me to frame forward these empty domains?
Intermediate & Advanced SEO | | IoanSaid0 -
Blocking Dynamic URLs with Robots.txt
Background: My e-commerce site uses a lot of layered navigation and sorting links. While this is great for users, it ends up in a lot of URL variations of the same page being crawled by Google. For example, a standard category page: www.mysite.com/widgets.html ...which uses a "Price" layered navigation sidebar to filter products based on price also produces the following URLs which link to the same page: http://www.mysite.com/widgets.html?price=1%2C250 http://www.mysite.com/widgets.html?price=2%2C250 http://www.mysite.com/widgets.html?price=3%2C250 As there are literally thousands of these URL variations being indexed, so I'd like to use Robots.txt to disallow these variations. Question: Is this a wise thing to do? Or does Google take into account layered navigation links by default, and I don't need to worry. To implement, I was going to do the following in Robots.txt: User-agent: * Disallow: /*? Disallow: /*= ....which would prevent any dynamic URL with a '?" or '=' from being indexed. Is there a better way to do this, or is this a good solution? Thank you!
Intermediate & Advanced SEO | | AndrewY1 -
Migrating a site with new URL structure
I recently redesigned a website that is now in WordPress. It was previously in some odd, custom platform that didn't work very well. The URL's for all the pages are now more search engine friendly and more concise. The problem is, now Google has all of the old pages and all of the new pages in its index. This is a duplicate problem since content is the same. I have set up a 301 redirect for every old URL to it's new counterpart. I was going to do a remove URL request in Webmaster Tools but it seems I need to have a 404 code and not a 301 on those pages to do that. Which is better to do to get the old URL's out of the index? 404 them and do a removal request or 301 them to the new URL? How long will it take Google to find these 301 redirects and keep just the new pages in the index?
Intermediate & Advanced SEO | | DanDeceuster0