Domain.com and domain.com/ redirect(error)
-
When I view my campaign report I'm seeing duplicate content/ meta for mydomain.com and mydomain.com/ (with a slash)
I already applied a 301 redirect as follows:
redirect 301 /index.php/ /index.php
Where am I messing up here?
-
Actually I figured out all of the problems, here is the solution that worked for me:
RewriteEngine On
RewriteBase /#Rewrite bare to www
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
-
Hi Cgman,
There are a couple things you can try here. I assume you're using .htaccess for the redirect? I'm not an expert on these, and they can get messed up pretty quickly, but I'd start by listing the full url in the second instance, like this:
Redirect 301 /index.php/ http://www.example.com/index.php
Another easy way to solve this problem is with a canonical tag. Just make sure both pages have a duplicate canonical tag in the section that points to the same target, like this:
To be honest, although these are technically duplicates you are dealing with, Google has publicly stated that trailing slashes aren't that big of deal, so if you can't invest the time in fixing it, it probably won't hurt you that much.
Hope this helps! Best of luck with your SEO.
-
Anyone have any other ideas?
-
That seemed to work somewhat, however the inner page linking broke completely.
... no longer loads
-
Try
RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/ RewriteRule ^(([^/]+/)*)index\.php$ http://example.com/$1 [R=301,L]
Ref:
-
Yeah I re-crawled it after applying the 301. Here is my full htaccess:
RewriteEngine On
RewriteBase /
#Rewrite bare to www
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]redirect 301 /index.php/ /index.php
Supposed to redirect from nonwww to www, hide .php from pages to look clean: domain.com/category vs domain.com/category.php Then finally redirect index.php/ to index.php
-
After you fixed the issue did you wait till the next report was generated to see if the crawl detected the same error?
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
-
Using one domain for email and another domain for your website, but redirects...
Hello - We are rebranding and our new name is fairly lengthy. We own all main domain versions of our brand name - .com, .new and .org - There is a very high search volume for the new brand name as it is a merger of 2 popular existing brands so want to take advantage of that and use our full name within our website domain name. However, since the name is a little long as mentioned - 25 characters - we also own the 3 character acronym of the new brand so we are debating on using the acronym for our new email addresses. ie [email protected] so it is user friendly. We would obviously redirect the acronym email domain to point to the longer website domain. Are there any negative SEO effects if we do that? Use the longer domain for the website and shorter acronym for our email? Thank you
Technical SEO | | KRBishopBh1 -
Trash Domain Or Redirect it (unmaintained)
We have an old website with an old domain that has not been maintained for a few years; it now has a DA of 14 and a spam score of 24%. Our current domain (same business) within a few years has a domain authority of 21 and page authority 29 spam score 1%. (Yes, this domain should have been redirected from the get-go) The question is what do you do with it now? Toss it. Or redirect it. That domain has existed for years but still not sure what its value is from an SEO perspective. I would love to hear your feedback. Is there any benefit to redirect the old domain to the current domain. Or is it a negative and what impact?
Technical SEO | | MyBambooSEO0 -
Is it better to use XXX.com or XXX.com/index.html as canonical page
Is it better to use 301 redirects or canonical page? I suspect canonical is easier. The question is, which is the best canonical page, YYY.com or YYY.com/indexhtml? I assume YYY.com, since there will be many other pages such as YYY.com/info.html, YYY.com/services.html, etc.
Technical SEO | | Nanook10 -
301 Redirect for 3 Domains into 1 New Domain
So I wanted a quick sanity check on the htaccess syntax for migrating 3 domains into 1 new domain. For example, we're migrating 3 sites abc.com, def.com and ghi.com, all into 1 new site on ghi.com. Here's the htaccess we're placing on the root of ghi.com: redirect 301 http://www.abc.com/wines.html http://www.ghi.com/wines redirect 301 http://www.def.com/trade.html http://www.ghi.com/trade
Technical SEO | | cmaseattle
redirect 301 http://www.ghi.com/winery-tours.html http://www.ghi.com/visit/taste On the DNS side of things, we're parking abc.com and def.com on the ghi.com server. I'm not seeing examples of htaccess files for this scenario, and none that use any domain info on the "from" side of the redirect 301 syntax. Any suggestions before we pull the trigger? Thanks!0 -
Redirecting Root domain to subdirectory by IP addresses (country specific)
We are using Wordpress Multisite. so www.mysite.com is our English website and www.mysite.com/sub is our Chinese website Can I redirect Chinese visitors who type "www.mysite.com" to "www.mysite.com/sub" ? so we want to force redirection to www.mysite.com/sub if our website is visited by Chinese IP Address. I've realized that this is called GeoIP Redirection. and our hosting company already has those database, I guess my job is just to simply insert some code in .htacess My question is, would it affect our SEO later on? and what .htacess code is the best practice here?
Technical SEO | | joony20080 -
Redirect
Hello, I need to redirect just the homepage of my blog somewhere. So blog.com But there are other redirects in there and I don't want to override them. So blog.com/post.html How do I just redirect the homepage of wordpress page without redirecting all the other pages. This is what I did that recreated the issue. redirect 301 / blog2.com Thanks! Tyler
Technical SEO | | tylerfraser0 -
Http:// vs http://www.
Why is it that when I run an "On Page Optimization Keyword Report" for my website I get a different score when using http://www.tandmkitchens.com vs http://tandmkitchens.com. My keyword is "Kitchen Remodeling" http://www.tandmkitchens.com scores an A http://tandmkitchens.com scores a B It's the same page yet one url scores higher than the other. Any help! Thanks
Technical SEO | | fun52dig
Gary0 -
Domain Masking with New Keyword-Rich Domains
Hello, friends. We have an ecommerce site and we also own several keyword-rich domains but haven't done anything with them yet. Is there any value in using domain masking to point them to either product pages or special landing pages on our primary ecommerce site? Here's an example: Primary site is widgetzone.com Keyword rich URL is acmewidget.com (which is totally blank and isn't indexed) It could point to our category page for Acme Widgets: widgetzone.com/category/acme-widgets or it could point to a new landing page: widgetzone.com/acme-widgets My concern is that because the keyword-rich URL hasn't been utilized at all there's really no point in redirecting it. I'm of the mind that it's either going to be ineffective at best or a duplicate content issue at worst. What do you guys think? As a follow-up, if we don't redirect these domains, what should we do with them? Just try to sell them off rather than create totally new sites?
Technical SEO | | jbreeden0