We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21136
    • 103 Posts
    Hello smiley

    I have been running a site on MODx .95 for 5-6 months now.

    Recently I have noticed that some pages are being indexed as: "http://domain.com/page.htm" but should be indexed as "http://www.domain.com/page.htm". For some reason it is not picking up the "WWW".

    I have a XML sitemap and a regular htm sitemap. They both reflect WWW in each page URL.

    I have looked in the "Tools -> Configuration" tab to make sure everything looks ok and it does.

    Does anyone have any idea why the serps are picking the url’s up this way. I have verified that Google, Yahoo and MSN are reflecting this mix of URL’s (ie. www.domain.com and domain.com)?

    What in MODx could possibly be causing this?

    Regards,

    Ken Roberts
      • 4707
      • 73 Posts
      Don’t know why you have the problem, but you can fix it by using these lines in your .htaccess file
      # or for the opposite domain.com -> www.domain.com use the following
      # >>> DO NOT USE BOTH THE ABOVE AND BELOW <<<
      #
      RewriteCond %{HTTP_HOST} .
      RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
      RewriteRule (.*) http://www.example-domain-please-change/$1 [R=301,L]
      


      so any access to domain.com will be permanently redirected (301) to www.domain.com. After some time your site should be indexed the way you want.

      You can also tell google your preferred domain in the Google Webmaster Tools. Not sure how much this would speed up the re-indexing though.
        • 13993
        • 100 Posts
        You really should install the SEO Strict URLs Plugin
          • 21136
          • 103 Posts
          Cassiel,

          Thanks for the response. After I wrote my original post I did alter my .htaccess file to reflect the 301 redirect you suggest also. At least I am thinking in the right direction. I already have a Webmaster account and I also did as you suggeested with selecting my preffered domain name.

          In the meantime if anyone else has any ideas why this might be happening I would appreciate any more feedback

          Regards,

          Ken Roberts
            • 21136
            • 103 Posts
            Great !!

            Where do I find the SEO Strict URLs Plugin.

            Regards,

            Ken Roberts
              • 13993
              • 100 Posts