URL Structure Question
-
Hey folks,
I have a weird problem and currently no idea how to fix it. We have a lot of pages showing up as duplicates although they are the same page, the only difference is the url structure. They seem to show up like:
http://www.example.com/page/
andhttp://www.example.com/page
What would I need to do to force the URLs into one format or the other to avoid having that one page counting as two? The same issue pops up with upper and lower case:
http://www.example.com/Page
andhttp://www.example.com/page
Is there any solution to this or would I need to forward them with 301s or similar?
Thanks,
Mike
-
What happens when you naviaget to these urls,
[http://www.example.com/page/](http://www.example.com/page/)
and[http://www.example.com/page](http://www.example.com/page)
do they resolve to one or the other, or do both render the page?
The answer is to 301 to one or the other, and make sure you are not using both formats in your site.
-
Hey Mike,
Opt is correct the .htaccess file is the way to go but I would first test this in a sandbox / development environment as messing with this file can bring your entire site down quickly if you get it wrong (and sometimes you think you have it right and there is a knock effect elsewhere).
Failing that you could always add rel canonical tags to your site which either use the trailing slash format or not. This may be easier to do depending on the CMS you are using.
-
I believe the easiest way would be to add or remove the trailing slash in your .htaccess file in the root directory.
Make sure you backup your .htaccess file before you edit it!
The below may work for you but I would guess someone more experience in this area could help more with the coding:
"
Use this code to your .htaccess file to remove trailing slashes:
#get rid of trailing slashes
RewriteCond %{HTTP_HOST} ^(www.)?turbocelica.lv$ [NC]
RewriteRule ^(.+)/$ http:/www.example.org/$1 [R=301,L]or use this code to ADD trailing slash to the end of each URL:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)([^/])$ http://www.example.org/$1$2/ [R=301,L]"
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 301 Re-direct
Hello, If we publish a blog post with a url which accidentally contains a number at the end (blog.companyname.com/subject-title-0), is it best-practice to update the URL (e.g. to blog.companyname.com/subject-title) and put in a 301 re-direct from the old to the new one or should it simply be left as is? I've read that 301's lose link equity and relevance so is it really worth re-directing for the sake of a cleaner url? Thanks for your input! John
Technical SEO | | SEOCT1 -
URL ASCII Characters Issue
Hi guys; Is there any different between URL whit capital ASCII code and URL with small ASCII Code? For example I have 2 URLS for one page like this: 1- 332-%D8%AA%D8%AD%D8%B5%DB%8C%D9%84-%D8%AF%D8%B1-%DA%A9%D8%A7%D9%86%D8%A7%D8%AF%D8%A7.html 2- 332-%d8%aa%d8%ad%d8%b5%db%8c%d9%84-%d8%af%d8%b1-%da%a9%d8%a7%d9%86%d8%a7%d8%af%d8%a7.html both of them point to same page but no 1 is non SSL and no 2 is ssl version! and whole pges of site forces to https
Technical SEO | | seoiransite0 -
Hi - I have a question about IP addresses
- would it hurt link juice to host a blog on a different server to the rest of your website? I have a web host saying they can't run Wordpress as they won't support PHP for "security reasons" - one solution would be to set up Wordpress on a different server and redirect domain.com/blog there (I presume this is do-able?). But I don't know if that affects the SEO adversely?
Technical SEO | | abisti21 -
Sitemap question
Hello, In your opinion what is better for a root domain and micro-sites using sub-domains?, to have a single sitemap for the root domain including all links to the sub-domains or to have a separate sitemap for each sub-domain? Thanks Arnold
Technical SEO | | arnoldwender0 -
Sitelink Demotion Question
A non profit in our industry that we support pro bono--the awesome Efficiency First--is finding that individual member listings are sometimes showing up within their sitelinks. This obviously does not sit well with the members who do not show up. I know that you can "demote" specific URL's within webmaster tools, but I'm wondering if it's possible to demote an entire section. Their structure is www.efficiencyfirst.org/member/member#. Do we demote the entire member section? Or is there a more structural problem at play here? Thanks much. 2IZuPkD.png
Technical SEO | | PeterTroast0 -
Duplicate video content question
This is really two questions in one. 1. If we put a video on YouTube and on our site via Wistia, how would that affect our rankings/authority/credibility? Would we get punished for duplicate video content? 2. If we put a Wistia hosted video on our website twice, on two different pages, we would get hit for having duplicate content? Any other suggestions regarding hosting on Wistia and YouTube versus just Wistia for product videos would be much appreciated. Thank you!
Technical SEO | | ShawnHerrick1 -
I'm redesigning a website which will have a new URL format. What's the best way to redirect all the old URLs to the new ones? Is there an automated, fast way to do this?
For example, the new URL will be: https://oregonoptimalhealth.com/about_us.html while the old one's were like this: http://www.oregonoptimalhealth.com/home/ooh/smartlist_1/services.html I have redirect almost 100 old pages to the correct new page. What's the best and easiest way to do this?
Technical SEO | | PolarisMarketing0 -
Question on 301s
Hi Everyone, I have a questions on 301 redirects, i hope someone can give me some help on this. There was some 301 redirects made on some of the URLs at the beginning of the year, however we are now re-structuring the whole website, which means the URLs which had been given a 301 redirect are now getting another 301. The question is, should i delete the first 301 redirect from the htaccess file? Kind Regards
Technical SEO | | Paul780