We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26035
    • 2 Posts
    I can’t get urls to be case insensitive.

    The friendly url part is working by going to the document-alias, but the RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC] in the .htaccess file is not working.



    I’ve tried to add in the following plugin -

    /**
    * A MODx plugin to redirect URLs with incorrect case to actual URL.
    */
    $alias= null;
    if ($modx->config[’friendly_alias_urls’] == 1) {
        if (($modx->config[’use_alias_path’] == 1 && $modx->documentMethod == ’alias’ && $modx->event->name == ’OnPageNotFound’)) {
            $alias= (strlen($modx->virtualDir) > 0 ? $modx->virtualDir . ’/’ : ’’) . $modx->documentIdentifier;
        }
        elseif ($modx->event->name == ’OnWebPageInit’) {
            $alias= $modx->getDocumentIdentifier(’alias’);
        }
    }
    if ($alias) {
        if (!isset ($modx->documentListing[$alias])) {
            $documentListingNC= array_change_key_case($modx->documentListing);
            if (isset ($documentListingNC[strtolower($alias)])) {
                $actualDocId= $documentListingNC[strtolower($alias)];
                $modx->sendRedirect($modx->makeUrl($actualDocId), 0, ’’, ’HTTP/1.0 301 Moved Permanently’);
                exit();
            }
        }

    with ’OnWebPageInit’ and ’OnPageNotFound’ check in the System Events Tab. This did not work either.

    The ’Configuration/Friendly URLS’ are set as follows:
    Use friendly URLS: Yes
    Prefix for friendly URLS: blank
    Suffix for friendly URLS: blank
    Use friendly aliases: Yes
    Use friendly alias path: No
    Allow duplicate aliases: No
    Automatically generate alias: No

    ModX Version - 0.9.6.2

    Any help would be greatly appreciated! Thanks!
      • 20735
      • 2 Posts
      I’m having a similar problem, any help appreciated:

      I can’t get urls to be case insensitive.

      The friendly url part is working by going to the document-alias, but the RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC] in the .htaccess file is not working.

      I’m using Evolution 1.0.0
        • 26931
        • 2,314 Posts
        The friendly url part is working by going to the document-alias, but the RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC] in the .htaccess file is not working.
        did you try the plugin?
          • 14420
          • 13 Posts
          im also having this issue on evoution 1.0.2 from an upgraded 0.9.6.2

          The ’Configuration/Friendly URLS’ are set as follows:
          Use friendly URLS: Yes
          Prefix for friendly URLS: blank
          Suffix for friendly URLS: .html
          Use friendly aliases: Yes
          Use friendly alias path: No
          Allow duplicate aliases: No
          Automatically generate alias: Yes

          the Trans alias plugin is enabled, and future URL’s will not have this issue but existing ones that use uppercase are not working, i have tried the plugin even putting die(); in there has no effect.

          OnWebPageInit CHECKED
          OnPageNotFound CHECKED

          the rewrite rule in htaccess has

          RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
            • 14420
            • 13 Posts
            Bump
              • 3749
              • 24,544 Posts
              I found this:

              http://modxcms.com/forums/index.php/topic,39009.msg235246.html#msg235246

              [Update: I installed the final version of the plugin in that thread at Bob’s Guides and it seems to work.]

                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting