The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. How do i redirect www.domain.com/ to www.domain.com/index.php

    How do i redirect www.domain.com/ to www.domain.com/index.php

    Intermediate & Advanced SEO
    3 3 1.3k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mattmillen
      mattmillen last edited by

      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

      1 Reply Last reply Reply Quote 0
      • imageworks-261290
        imageworks-261290 last edited by

        use the rel="canonical" tag I believe http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394

        1 Reply Last reply Reply Quote 0
        • Dr-Pete
          Dr-Pete last edited by

          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.

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post
          • Moving html site to wordpress and 301 redirect from index.htm to index.php or just www.example.com
            zeehj
            zeehj
            0
            4
            1.3k

          • Change domain.com to www.domain.com - influence on linkbuilding, seo, etc.
            solvid
            solvid
            0
            5
            267

          • Putting my content under domain.com/content, or under related categories: domain.com/bikes/content ?
            Andy.Drinkwater
            Andy.Drinkwater
            0
            2
            69

          • Domain Authority... http://www.domain.com/ vs. http://domain.com vs. http://domain.com/
            MattAntonino
            MattAntonino
            0
            4
            136

          • Domain.com/old-url to domain.com/new-url
            Edzjus333
            Edzjus333
            0
            10
            162

          • Https://www.mywebsite.com/blog/tag/wolf/ setting tag pages as blog corner stone article?
            AlirezaHamidian
            AlirezaHamidian
            0
            6
            135

          • URL Redirect: http://www.example.net/ vs. http://www.example.net
            dotfly
            dotfly
            0
            2
            705

          • Another duplicate page title www.domain.com vs www.domain.com/index.html question
            Matt-Williamson
            Matt-Williamson
            0
            2
            405

          Get started with Moz Pro!

          Unlock the power of advanced SEO tools and data-driven insights.

          Start my free trial
          Products
          • Moz Pro
          • Moz Local
          • Moz API
          • Moz Data
          • STAT
          • Product Updates
          Moz Solutions
          • SMB Solutions
          • Agency Solutions
          • Enterprise Solutions
          • Digital Marketers
          Free SEO Tools
          • Domain Authority Checker
          • Link Explorer
          • Keyword Explorer
          • Competitive Research
          • Brand Authority Checker
          • Local Citation Checker
          • MozBar Extension
          • MozCast
          Resources
          • Blog
          • SEO Learning Center
          • Help Hub
          • Beginner's Guide to SEO
          • How-to Guides
          • Moz Academy
          • API Docs
          About Moz
          • About
          • Team
          • Careers
          • Contact
          Why Moz
          • Case Studies
          • Testimonials
          Get Involved
          • Become an Affiliate
          • MozCon
          • Webinars
          • Practical Marketer Series
          • MozPod
          Connect with us

          Contact the Help team

          Join our newsletter
          Moz logo
          © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
          • Accessibility
          • Terms of Use
          • Privacy