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. On-Page / Site Optimization
    4. Removing non www and index.php

    Removing non www and index.php

    On-Page / Site Optimization
    1 1 60
    • 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.
    • KeithBugeja
      KeithBugeja last edited by

      Hi,

      I'm green when it comes to altering the htaccess file to remove non www and index.php.

      I think I've managed to redirect the urls to www however not sure if I've managed to remove the index.php.

      I'm pasting the contents of the htaccess file here maybe someone can identify if I have unwanted lines of code and if it is up to standard (there are a lot of comments in #) not sure if needed but I've left them as I don't want to screw up anything. Thanks ๐Ÿ™‚

      @package Joomla

      @copyright Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved.

      @license GNU General Public License version 2 or later; see LICENSE.txt

      READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!

      The line 'Options +FollowSymLinks' may cause problems with some server configurations.

      It is required for the use of mod_rewrite, but it may have already been set by your

      server administrator in a way that disallows changing it in this .htaccess file.

      If using it causes your site to produce an error, comment it out (add # to the

      beginning of the line), reload your site in your browser and test your sef urls. If

      they work, then it has been set by your server administrator and you do not need to

      set it here.

      No directory listings

      IndexIgnore *

      Can be commented out if causes errors, see notes above.

      Options +FollowSymlinks
      Options -Indexes

      Mod_rewrite in use.

      RewriteEngine On
      RewriteCond %{REQUEST_URI} ^/index.php/
      RewriteRule ^index.php/(.*) /$1 [R,L]

      Begin - Rewrite rules to block out some common exploits.

      If you experience problems on your site then comment out the operations listed

      below by adding a # to the beginning of the line.

      This attempts to block the most common type of exploit attempts on Joomla!

      Block any script trying to base64_encode data within the URL.

      RewriteCond %{QUERY_STRING} base64_encode[^(]([^)]) [OR]

      Block any script that includes a

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      • Www and non-www
        Bryan_Loconto
        Bryan_Loconto
        0
        5
        328

      • No index, or no index no follow?
        AuthorityLinkPartners
        AuthorityLinkPartners
        0
        3
        700

      • Www to non www redirect
        matbennett
        matbennett
        0
        8
        194

      • Www and non www site versions
        SanketPatel
        SanketPatel
        0
        3
        397

      • Duplicate page content & title for www.mydomain.com and www.mydomain.com/index.php?
        Carl287
        Carl287
        0
        3
        500

      • Rename index.php or keyword in URL?
        svdg
        svdg
        0
        12
        1.6k

      • Non www. page still ranking highest
        RyanKent
        RyanKent
        0
        2
        606

      • Is the www and non www isue realy seen by Google as duplicate content?
        AlanMosley
        AlanMosley
        0
        7
        1.3k

      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