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
-
Multiple CMS on one website / domain & SEO
For a client we would like to work with a content hub, but their website is build on a custom CMS so we are limited in our options and if we aks their web developers they ask crazy prices to help us. So now we have the idea to build the content hub with wordpress and implement it next to their current CMS. for example on www.website.com/contenthub/ . As far as i know this is technically possible and there are no negative effects regarding SEO as long as we link the two sitemaps together. Am i right or am i missing something here?
Technical SEO | | Siphoplait0 -
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 -
Do bad links to a sub-domain which redirects to our primary domain pass link juice and hurt rankings?
Sometime in the distant past there existed a blog.domain.com for domain.com. This was before we started work for domain.com. During the process of optimizing domain.com we decided to 301 blog.domain.com to www.domain.com. Recently, we discovered that blog.domain.com actually has a lot of bad links pointing towards it. By a lot I mean, 5000+. I am curious to hear people's opinions on the following: 1. Are they passing bad link juice? 2. does Google consider links to a sub-domain being passed through a 301 to be bad links to our primary domain? 3. The best approach to having these links removed?
Technical SEO | | Shredward0 -
301 Redirect question www to root.com
I have a site that has been up for a few weeks now and is currently in a www format and i am considering changing it to just mydomain.com I also have quite a few directory listings (including google places/bing) for this site w/ the www. url. If i do this, change it in my google analytics, and update my wordpress internal page + htaccess file. Will i lose any of the link juice i had from my www pages? Would this be something that would be advised since i've registered for many sites, or is there a potential that this could end up hurting me? Thanks,
Technical SEO | | tgr0ss0 -
Getting multiple errors for domain.com/xxxx/xxxx/feed/feed/feed/feed...
A recent SEOMoz crawl report is showing a bunch 404's and duplicate page content on pages with urls like http://domain.com/categories/about/feed/feed/feed/feed/feed and on and on. This is a wordpress install. Does anyone know what could be causing this or why SEOMoz would be trying to read these non-existent feed pages?
Technical SEO | | Brandtailers0 -
Help with domain redirect advice please!
I run the website http://buildyourjacket.com. We have other domains as well, most importantly www.buildyourjacket.com and cvcsports.com. If you Google "letterman jackets" (our primary search term) cvcsports.com shows up as the first result (yay!). But that is not what we want. Until a few weeks ago, Google would show http://buildyourjacket.com as the domain for the first search result from "letterman jackets". But then a few weeks that changed. I don't know how that could have happened. There are two reasons why we want the domain http://buildyourjacket.com to be the one that shows up: 1) It's a better sounding/looking domain and 2) When it was showing up, Google also showed right below the domain another link of our that said "Build Your Own Jacket" which definitely helped us get more clicks. Can someone please help me and tell me what I should do? Thank you so much.
Technical SEO | | BrandonDoyle0 -
TLD - ".com.br" X ".com" which to use?
Hello I'm starting an SEO work on a site that has the domain "www.dominiodocliente.com" and "www.dominiodocliente.com.br." The problem is that the domain name. ".com" already has a low rank for keywords chosen as the domain "Com.br" has no rank. On the other hand, the domain ". Com" has 224 results in google as the domain "Com.br" has 1970 results. My question is: Which domain should I focus on SEO work? Tks
Technical SEO | | eder.machado0 -
Accidently did a 301 redirect on root domain and lost domain keyword position
I just bought a domain about a week ago and instantly ranked number 4 for for my keywords with the domain keyword bonus. I created a landing page off the root of my domain while I'm building out my main site. I accidentally did a 301 redirect instead of a 302 from my root to my landing paging and this resulted in me losing my position and only being about to find my domain in the google if I searched for my domain specifically. Anyway to regain my original position? I have removed the redirect. Have I been put in the sandbox?
Technical SEO | | JohnTurner790