Index.php duplicate content
-
Hi, new here.
Im looking for some help with htaccess file.
index.php is showing duplicate content errors with:
ive managed to use the following code to remove the www part of the url:
IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]but how can i redirect the mysite.com/index.php and mysite.com/ to mysite.com.
Please help
-
Of course! Glad I could help.
-
Great thankyou so much.
Also another interesting person to follow on twitter
-
Once your trial runs out, you won't be able to respond, but at least you'll still be able to see my answer!
I think you can use the .htaccess file redirect command:
Redirect 301 /location/from/root/file.ext http://www.othersite.com/new/file/location.xyz
So, it should be:
Redirect 301 /index.php http://mysite.com
Redirect 301 / http://mysite.com
If that doesn't work, here's someone with the same problem on StackExchange.
P.S. Glad you like the Distilled course.
-
Hi Kristina,
No unfortunately my question was misunderstood.
It wasn't the file extension i was looking to hide.
I was looking to redirect mysite.com/index.php to mysite.com/ or mysite.com via an htaccess file.
Im currently working through distilled's online course (nice course btw) , I was hoping to get an answer here :http://www.distilled.net/u/technical/#technical-duplicate-content, (Homepage Canonicalization), but i couldnt find one
This is not a critical question, as im just tinkering around on friends sites, but i would like to learn this.
Unfortunately my free seomoz trial runs out today and im waiting until I have completed distilled's course's before i renew my moz subscription, so i can make better use of moz tools, so i may not be able to see your reply.
Is it cool to tweet @ you?
-
Hey David,
Just wanted to follow up with you on this - did TextMarketing's method work?
-
<code>## hide .php extension # To externally redirect /dir/foo.php to /dir/foo RewriteCond%{THE_REQUEST}^[A-Z]{3,}\s([^.]+)\.php [NC]RewriteRule^%1[R,L,NC]</code>
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 to avoid duplicate content
Hi, I have a website which is ranking on page 1: www.oldname.com/landing-page But because of legal reason i had to change the name.
Technical SEO | | mikehenze
So i moved the landing page to a different domain.
And 301'ed this landing page to the new domain (and removed all products). www.newname.com/landing-page All the meta data, titles, products are still the same. www.oldname.com/landing-page is still on the same position
And www.newname.com/landing-page was on page 1 for 1 day and is now on page 4. What did i do wrong and how can I fix this?
Maybe remove www.oldname.com/landing-page from Google with Google Webmaster Central or not allow crawling of this page with .htaccess ?0 -
Crawling and indexing content
If a page element (div, e.g.) is initially hidden and shown only by a hover descriptor or Javascript call, will Google crawl and index it’s content?
Technical SEO | | Mont0 -
SEO with duplicate content for 3 geographies
The client would like us to do seo for these 3 sites http://www.cablecalc.com/ http://www.solutionselectrical.com.au http://www.calculatecablesizes.co.uk/ The sites have to targetted in US, Australia, and UK resoectively .All the above sites have identical content. Will Google penalise the sites ? Shall we change the content completly ? How do we approach this issue ?
Technical SEO | | seoug_20050 -
Duplicate Content from Google URL Builder
Hello to the SEOmoz community! I am new to SEOmoz, SEO implementation, and the community and recently set up a campaign on one of the sites I managed. I was surprised at the amount of duplicate content that showed up as errors and when I took a look in deeper, the majority of errors were caused by pages on the root domain I put through Google Analytics URL Builder. After this, I went into webmaster tools and changed the parameter handling to ignore all of the tags the URL Builder adds to the end of the domain. SEOmoz recently recrawled my site and the errors being caused by the URL Builder are still being shown as duplicates. Any suggestions on what to do?
Technical SEO | | joshuaopinion0 -
Duplicate content question with PDF
Hi, I manage a property listing website which was recently revamped, but which has some on-site optimization weaknesses and issues. For each property listing like http://www.selectcaribbean.com/property/147.html there is an equivalent PDF version spidered by google. The page looks like this http://www.selectcaribbean.com/pdf1.php?pid=147 my question is: Can this create a duplicate content penalty? If yes, should I ban these pages from being spidered by google in the robots.txt or should I make these link nofollow?
Technical SEO | | multilang0 -
Avoiding duplicate content/same pages
hi I have been checking through all the Q and A but i i'm still not sure how you get http://www.domain.co.uk/index.html to be just http://www.domain.co.uk/? Do you add canonical to the index page to point to the page you prefer and then add a 301 redirect? thanks
Technical SEO | | challen0 -
Duplicate content
I have to sentences that I want to optimize to different pages for. sentence number one is travel to ibiza by boat sentence number to is travel to ibiza by ferry My question is, can I have the same content on both pages exept for the keywords or will Google treat that as duplicate content and punish me? And If yes, where goes the limit/border for duplicate content?
Technical SEO | | stlastla0