We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    My site can be found at two different locations: mysite.com/index.php and mysite.com/ How can I fix this? Is this an .htaccess rule fix? It's showing up as duplicate content and killing my SEO work. I'm not sure how to fix it and haven't had much luck browsing the forums. Many thanks!
      The MODx has you...
      Utah Web Design
      • 4749
      • 623 Posts
      OK, so I got this sorted... It was an .htaccess issue. I just dug around in the forums and pieced together these rules based on forum posts:

      Options +SymLinksIfOwnerMatch
      RewriteEngine On
      RewriteBase /

      # Fix Apache internal dummy connections from breaking [(site_url)] cache
      RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
      RewriteRule .* - [F,L]

      #Redirect http://www.mysite.com/index.html to http://www.mysite.com/
      RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
      RewriteRule ^index\.html$ http://www.mysite.com/ [R=301,L]

      #Redirect http://www.mysite.com/index.php to http://www.mysite.com/
      RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
      RewriteRule ^index\.php$ http://www.mysite.com/ [R=301,L]

      # Exclude /assets and /manager directories and images from rewrite rules
      RewriteRule ^(manager|assets)/*$ - [L]
      RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]

      # For Friendly URLs
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

      RewriteCond %{HTTP_HOST} ^mysite\.com [NC]
      RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
        The MODx has you...
        Utah Web Design