We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26313
    • 3 Posts
    Hi all!
    Please, help to solve a problem.

    When i’m using friendly urls, the page is accessible in two addresses.
    For example, URL alias of the page is "about" and URL suffix is ".html"

    So, this page is accessible as:

    http://www.site.com/about and http://www.site.com/about.html

    Google see both of them, i don’t want that

    How to redirect first address to second huh
    When i’m tryin to redirect it with htaccess, then i get a redirecting loop, because
    for default there are also:

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


    ================================

    temporary solved, i wrote simple plugin (System Event - OnLoadWebDocument):

    $request_url = $_SERVER['REQUEST_URI'];
    if($request_url != '/' && substr($request_url, -5) != '.html')
    {
        $request_url .= '.html';
        header("Location: $request_url");
    }
    


    UPD
    MODx version: evolution 1.0.4

    2 lucas
    suffix ".html" is necessary

      • 33337
      • 3,975 Posts
      Which version of MODX you are using? if its Evolution then checkout http://modxcms.com/forums/index.php?topic=12452.msg82738#msg82738
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 33968
        • 863 Posts
        Is that Revo?

        What if you remove the .html url suffix so the page is only available at site.com/about

        Cleaner that way too smiley