How do i redirect www.domain.com/ to www.domain.com/index.php
-
I keep getting in my analytics www.domain.com/ and www.domain.com/index.php how do i make it consistently redirect to one version and not to both.
I know about htaccess redirect and am already using this so am puzzle to which is the best one to use.
below is the example .htaccess file im using.
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.co.uk [nc]
rewriterule ^(.*)$ http://www.domain.co.uk/index.php$1 [r=301,nc]which is better for SEO should i forward to www.domain.com/ or www.domain.com/index.php
-
I'd actually do it the other way - redirect "index.php" to the root ("/") version - Google seems to prefer that and many of your inbound links will be to the root domain (people naturally default to it). Make sure your internal links point to that ("/") as well. See this post that expands on that and gives some .htaccess examples:
http://www.searchmasters.co.nz/articles/78/redirecting-indexphp-to-root-using-htaccess/
You can add the canonical tag to help sweep up the problem, but I think it's best to have a solid 301-redirect in place here, especially if both versions are showing up in analytics.
-
use the rel="canonical" tag I believe http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394
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
-
.co.uk to .com domain move Dec 26th, still 40% down - do I risk moving back? (desperate)
Hi All, I'm desperate for a bit of advice. I run www.tyrereviews.com which has been my project since 2006, and after LOTS of hard work over 15 years held 1000's of P1 positions in the SERPs. I recently moved from the original .co.uk to .com to aid with future internationalising plans. I was very careful not to change ANYTHING else, just 301 from the UK to the .com and updated everything in webmaster consoles. My background is development and I spent weeks triple researching everything to make sure I followed all the google best practices, as this is my life's work and primary income source. From a tech point of view the change went perfectly, but sadly google quickly started deranking the new domain, and now two months on it seems to have stabilised at around 40% down on traffic year on year and mostly dropped from the UK region. This is mostly from medium to long tail keywords. One such example is "Michelin Primacy 4" in google UK, old webmaster tools is showing my average position this time last year as 1.4 and now I'm 12.4! The .com site is geo targeted to the UK by both webmaster tools and href lang tags. So, my question is, so I keep waiting, or do I give up andrisk the switch back to the uk domain before it's too late? Thanks in advance.
Intermediate & Advanced SEO | | TyreReviews0 -
Is it worth keeping a decades-old domain that's merely 301 redirecting to the main domain?
Hi fellow Moz SEOs, We have a bigger client who we just did an SEO Site Audit for, and it was discovered that they have several domain names that are simply 301 redirecting to their main domain name. One of their domains in particular is decades old, and the client is asking if there is any value in keeping it (and the others), or simply leaving them as-is. Considering the domain age, does anyone have any recommendations? Much appreciated, Zack Barton
Intermediate & Advanced SEO | | Zack
Barton Interactive
(833) 442.6853 // office
(408) 910.7750 // mobile
https://bartoninteractive.com0 -
Domain switch planned - new domain accessible - until the switch: redirect from new to old domain with 307?
Hi there, We are going to switch our local domain oldsite.at to newsite.com in November. As our IT department wants to use the newsite.com already for email traffic till then, the domain newsite.com has to be accessible for public and currently shows the default Apache page without useful content. The old domain has quite some trust, the new domain is a first time registered domain (not known by search engines yet and no published anyhow). The domain was parked till now. I am aware of the steps to take for the switch itself, but: **what to do with the newsite.com domain until everything is prepared for the switch? **I suppose users or search engines find the domain and as there is no useful information available it harms us already. My idea was to 307 redirect newsite.com to the oldsite.at but the concern is that this causes problems as soon as we switch the domain and redirecting with 301 from oldsite.at to newsite.com? Do you have any objections or other recommendations? Thank you a lot in advance.
Intermediate & Advanced SEO | | comicron0 -
To redirect or not to redirect, that is the question
I work for a software company that is redeveloping the website (same domain.) We have tons of content in the form of articles and documents for support, how to use the product better, case studies, and blog posts. I've downloaded a landing page report and many of these have low impressions and little or no clicks (some ranked high other very low.) Should I redirect all this content to the new site where some of it won't exist or forget about it because of the lack of juice? Is there a rule-of-thumb threshold for redirecting for content?
Intermediate & Advanced SEO | | Nobody15969167212220 -
Subdomain SEO question (php script on domain + wordpress on subdomain)
Hi Moz fellows, I am doing my first website which is entirely .php scripted. But I would like to have a wordpress blog to create content and blog posts, while the .php side of the website is more for sales pages and user generated listings.The only way to do this is to install wordpress on a subdomain "blog.website.com" QUESTION: If all my keywords targeted content is on the subdomain's Wordpress blog, but all my guest blogging efforts link to my main website, which one will rank? The subdomain or the domain? I need the domain to rank well as it is a Fiverr-like script, so if tons of people land on my "blog.website.com" subdomain, they will not convert into users... Let me know if you have experience with such a scenario, and thank you all in advance for your help! -Marc
Intermediate & Advanced SEO | | marcandre0 -
SEO value in baclklink from blog.domain VS domain
Will a back-link from "domain.com/abc" and "blog.domain.com/abc" have same value from an SEO perspective? Assume same article written on both sites.
Intermediate & Advanced SEO | | knielsen
I have been told the bots look at the domain value and the only links from blogs that have less value are in case of comments. As long as the "blog.domain/abc" page includes a full article and not a blog comment then it counts fully for SEO. Is this correct?0 -
Does Google Index an Alert Div w/Delayed Hide
We have a div at the top of a client's the page that displays an alert to the user. After 30 seconds it is rendered hidden. Does Google index this? Does Google take this into account when it ranks the page?
Intermediate & Advanced SEO | | WEOMedia0 -
Http://blogsearch.google.com/ping
Is there any reason why a website would submit all their content (videos, photo galleries, articles) to this?
Intermediate & Advanced SEO | | MargaritaS0