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
-
I've consolidated other domains to a single one with 301 redirects, yet the new domain authority in MOZ is much less that the redirected ones. Is that right?
I'm trying to increase the domain authority of my main site, so decided to consolidate other sites. One of the other sites has a much higher domain authority, but I don't know why after a 301 redirect, the new site's domain authority hasn't changed on over a month. Does MOZ take account of thes types of things?
Technical SEO | | bytecgroup2 -
What is the best practice to seperate different locations and languages in an URL? At the moment the URL is www.abc.com/ch/de. Is there a better way to structure the URL from an SEO perspective?
I am looking for a solution for using a new URL structure without using www.abc.com**/ch/de** in the URL to deliver the right languages in specific countries where more than one language are spoken commonly. I am looking forward to your ideas!
Technical SEO | | eviom0 -
Best way to create a shareable dynamic infographic - Embed / Iframe / other?
Hi all, After searching around, there doesn't seem to be any clear agreement in the SEO community of the best way to implement a shareable dynamic infographic for other people to put into their site. i.e. That will pass credit for the links to the original site. Consider the following example for the web application that we are putting the finishing touches on: The underlying site has a number of content pages that we want to rank for. We have created a number of infogrpahics showing data overlayed on top of a google map. The data continuously changes and there are javascript files that have to load in order to achieve the interactivity. There is one infographic per page on our site and there is a link at the bottom of the infographic that deep links back to each specific page on our site. What is the ideal way to implement this infographic so that the maximum SEO value is passed back to our site through the links? In our development version we have copied the youtube approach implemented this as an iframe. e.g. <iframe height="360" width="640" src="http://www.tbd.com/embed/golf" frameborder="0"></iframe>. The link at the bottom of that then links to http://www.tbd.com/golf This is the same approach that Youtube uses, however I'm nervous that the value of the link wont pass from the sites that are using the infographic. Should we do this as an embed object instead, or some other method? Thanks in advance for your help. James
Technical SEO | | jtriggs0 -
301'ing domain to an addon domain
My googlefu failed me in finding this... How to 301 a domain to an addon domain? Domain structure is as follows: http://addondomain.maindomain.com/ http://www.maindomain.com/addondomain/ http://www.addondomain.com/ <--(addon domain has its own domain as well) I want main domain to all point to the addon domain like so: http://www.maindomain.com/ --> http://www.addondomain.com/
Technical SEO | | JasonJackson0 -
How do I stop www.mysite.com/ showing as a duplicate of www.mysite.com
I have run the campaigns software over a site and it is showing that www.mysite.com/ is a duplicate of www.mysite.com, how do I correct this? Is it a genuine duplicate page? My first thought was to use rel canonical but there is no page called / to put it on. Your suggestions welcomed Sean
Technical SEO | | ske110 -
Does it really matter to set 301 redirect for not found error pages?
I've very simple question for not found error pages. Does it really require to set up 301 redirect for all not found error pages which detected in Google webmaster tools? Honestly, I don't want to set 301 redirect exclude externally connected pages. So, what will impact on ranking after follow this process?
Technical SEO | | CommercePundit0 -
301 from old domain to new domain
Hi, I need to create a 301 redirect for all internal pages located on organic7thheaven.com to the homepage of our new site at http://www.7thheavennaturals.com/ Currently internal pages of the old site such as the following are returning a page not found www.organic7thheaven.com/products/deepcleansing/miraclemud.asp Can anyone help me in setting up a .htaccess file for this problem please? Thanks
Technical SEO | | MJMarketing0 -
Buying a SERPs competitor domain / site
For a specific term, we have the potential opportunity to purchase the domain (complete with site) that sits just above us in the Google search results... The domain has reasonable page authority of 49, domain authority of 38 with 168 linking root domains - 311 total links... Would the most beneficial use of the domain be to retain the site content as is and incorporate a few relevant links back to our site or... 301 the entire domain?
Technical SEO | | digitalarts1