We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    You do not need any .htaccess rewrite rules for this, just give it the appropriate alias and it will be handled automatically by MODx itself. Not sure why this is becoming so complicated; maybe I’m missing something here.
      • 22704
      • 42 Posts
      OG,

      Yes maybe I am making it too complicated. The original problem restated.
      Webmasters Crawl Errors found 26 errors linked to www.d.com/index.html
      Fetch as GoogleBot returned the index.html page but with a 404 and
      SearchMasters code suggests I have 6 potentially valid home pages which could dilute SEO efforts.
      And finally I have a goal of hiding extensions which is good FURL practise as you hide the underlying technology should a future change occur. Tim Berners-Lee "URLs should never change"


      SearchMasters results with your suggest of index.html as Alias and the original htaccess

      http://www.verdantconsulting.co.uk returns a 200 (OK) response. PR2
      http://verdantconsulting.co.uk returns a 200 (OK) response. PR2
      http://www.verdantconsulting.co.uk/index.php returns a 200 (OK) response. PR N/A
      http://verdantconsulting.co.uk/index.php returns a 200 (OK) response. PR N/A
      http://www.verdantconsulting.co.uk/index.htm returns a 404 not-found response
      http://verdantconsulting.co.uk/index.htm returns a 404 not-found response
      http://www.verdantconsulting.co.uk/index.html returns a 200 (OK) response. PR N/A
      http://verdantconsulting.co.uk/index.html returns a 200 (OK) response. PR N/A
      http://www.verdantconsulting.co.uk/index.shtml returns a 404 not-found response
      .....more 404s asp etc ....

      Results
      6 pages returned a 200 response. This indicates potential for duplicate content problems. Ideally, only http://www.verdantconsulting.co.uk OR http://verdantconsulting.co.uk should return a 200 response.

      I added the htaccess code suggested by SearchMasters hoping that the index.html URLs would be 301’d to the root but it didn’t work for index.html but worked for the others. Hence my confusion. Turned out it had to be done before the MODx FURL code. Which is fairly obvious with hindsight due to the hint provided by the code under...
      # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin


      Your alternative approach - use index.html for the home page FURL - (with all the new htaccess stuff still commented out) results in Webmasters Fetch as GoogleBot returning a nice 200 and so presumably the Crawl Errors will gradually disappear. Great. But the potential duplicate content still occurs and my mistake was to put the rewrite code after the FURL code. When it goes in the correct place in htaccess everyhing gets tidied up and as bunk58 suggests the index.html is hidden too.

      So, if MODx users aren’t worried about the use of index.html then as you suggest the home page should always have an URL Alias of index.html - maybe this is in the docs somewhere. But I feel the need to fix the potential problems indicated by searchmasters and also want to hide index.html and the htaccess changes do just that. Both approaches are required for what I’m trying to do (accepting that I’m probably being over fussy).

      Cheers

      Parthian