We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42161
    • 42 Posts
    I'm moving an old site that has both .htm and .html pages to MODX and the client wants to keep old page names as they were (for SEO reasons).

    As I understand, you can only have one suffix at a time (either .htm or .html), but not both.

    I tried to solve this through .htaccess file. What I want to achieve is that (1) all pages have .htm suffux [that's done] and (2) when a page pagename.html is requested, the site visitor is automatically redirected to the page pagename.htm, and (3) this rule be generic that is it will work for any page, whatever the alias.

    My current .htaccess reads as follows:
    php_value default_charset "UTF-8"
    AddDefaultCharset UTF-8
    
    RewriteEngine On
    RewriteBase /
    
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    

    Does anybody know a solution?
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      Hello,

      I would pick one and use Redirector (http://modx.com/extras/package/redirector) to reroute all of the other pages. That should maintain any SEO ranking for the page(s) in question. If you haven't already setting up a Google Sitemap (http://modx.com/extras/package/googlesitemap) will also help.

        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You can change the default suffix for your pages if you like. System -> Content Types, and just double-click on it to change the .html suffix of the text/html type to .htm. No need to fiddle with .htaccess or anything else.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          Quote from: sottwell at Nov 25, 2012, 02:18 PM
          You can change the default suffix for your pages if you like. System -> Content Types, and just double-click on it to change the .html suffix of the text/html type to .htm. No need to fiddle with .htaccess or anything else.

          The question is how to have .htm and .html
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting