We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6744
    • 5 Posts
    Thanks Mark. I’ll look around those sites to see if I can find anything.

    To clarify for others, on my aliases, they don’t actually have underscores or hyphens in them. Sorry for the confusion in my example. I just put those in for readability. My page naming convention is:

    mydomain.com/alias

    but the problem is, many of my users type in:

    mydomain.com/ALIAS

    And when modx tries to match the characters after the slash to the alias in the database, modx resolves "ALIAS" != "alias" and thus a redirect to the default page.

    I *think* my rewrite rules are working fine. What’s tripping me seems to be the case sensitivity is modx’s alias logic. I poked around the modx source for a while to see if I could hack a solution, but I wasn’t successful.
    Thanks again, Mark.
      • 22303 MODX Staff
      • 10,725 Posts
      Just write a quick plugin attached to OnPageNotFound and have it look up the alias after doing a strtolower() on it. If found, use $modx->sendRedirect to send it to the proper page/URL or $modx->sendForward() to leave the URL the same and just render the contents as is (though you may get penalized in search engines for having duplicate content with the latter approach).
        • 15871
        • 105 Posts
        Hi guys, and gals. Not sure if this has been covered, but I just found a solution that (of course) seems weird but makes complete sense when you think about it.

        I’ve had problems since the beginning working with the .htaccess and fURLs and have had situations where 2 IDENTICAL installs function differently. One worked, the other throws the 404. I have a subdomain (http://modxdemo.zerogny.net) pointing to a modxdemo subdomain on the server (BlueHost BTW). I set the rewrites to:

        Options +FollowSymlinks
        RewriteEngine On
        RewriteBase /

        as stated above in this thread.

        So...here’s why if you are working on a Mac and using Dreamweaver to edit your .htaccess file (as I was) that it never worked: The Macintosh line breaks where what was causing the file to not work! Unfortunately you can’t SEE this, since the breaks are invisible. I stumbled upon it simply by T&E. I opened the file in BBEdit, changed the line breaks to "Unix" and then re-saved. Uploaded the file and "voila." It works.

        Uuugh, hours and hours and it was a translation issue.

        Cheers, hope this helps.
          • 9162
          • 39 Posts
          Just for the other people out there who can’t think straight like me and decided to host their sites on IIS smiley , I had to have 404 and 405 custom error pages in place that redirects to /index.php . Then the MODx FURL’s worked perfectly.

          Thanks
          Ettiene
            • 29525
            • 388 Posts
            Hi

            I’m stuck trying to get Friendly URLs to work on my wamp server.

            I’m seeing the correct URLs http://localhost/services.html but I’m getting 404 errors on all the pages.

            Here’s what I’ve done.

            The site has been developed on my local wamp server.
            Modx is installed in the root directory
            Head contains
            <base href="[(site_url)]" />

            Configuration Settings
            Use Friendly URLs is yes
            Prefix is blank
            Suffix is .html
            Friendly aliases is yes
            Friendly alias path is no
            Duplicate aliases is no
            Auto generate alias is yes

            ht.access file contains
            RewriteEngine On
            RewriteBase /

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

            ht.access file in manager folder is renamed

            wamp\bin\apache2.2.6\conf\httpd.conf file has the following

            LoadModule rewrite_module modules/mod_rewrite.so (uncommented)

            <Directory "c:/wamp/www/">
            AllowOverride all

            I’ve cleared the cache in manager after each change

            I noticed some characters at the line ends. I removed them and resaved with notepad.

            MODx version 0.9.6.1p2
            PHP version 5.2.5
            SQL version 5.0.45

            Any suggestions? Not sure where to go next with this one.

            Thank you !

            Terry
              www.terrybarthdesign.com
              • 16308
              • 23 Posts
              I seem to be having a very similar problem to Terry. My modx site is installed in the public_html folder of my production server. It currently uses a temporary URL.

              the .htaccess file:

              RewriteEngine On
              RewriteBase /

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

              The config:

              Use Friendly URLs: yes
              Prefix: blank
              Suffix: .html
              Friendly allases: yes
              Friendly allases path: no
              Duplicate allases: no
              Automatically generate allases: yes

              I have included <base href="[(site_url)]" /> in the head of my template.
              and have also renamed the ht.access file in the manager directory.


              This one has had me stumped! I’m no master of the .htaccess file, but I understand that the file is being recognised and is working. I added document allases for example:

              about allas: about

              link generated /~abctest/about.html

              Returns 404 error.

              Any help would be greatly appreciated!

              Thanks


              edit: Should have read through this entire thread - I was lucky enough to randomly click on a page which had my solution:

              SOLVED: Problem here is the temporary URL. This should work once the actual domain name has been transfered and is in place.

              http://modxcms.com/forums/index.php/topic,4700.135.html

              Problem: bottom of page 9. Solution: top of page 10.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                I’ve never had any luck with friendly URLs when a site is using a temporary URL. I always end up using normal URLs until the final domain URL is available.
                  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
                  • 29525
                  • 388 Posts

                  So any suggestion on my situation? Wamp server?
                    www.terrybarthdesign.com
                    • 4310
                    • 2,310 Posts
                    @Terry
                    I use wampserver on a local machine with FURL enabled.
                    I wonder if your issue is having the site directly in the C:/wamp/www/ directory which is the root of localhost.
                    Normally you’d have the site in it’s own directory e.g. C:/wamp/www/mysite/ and have the .htaccess with RewriteBase /mysite
                      • 29525
                      • 388 Posts

                      Bunk58

                      Interesting quesiton. . .

                      If that’s the case, is there a fix?

                      I have an existing site in a hosted environment where modx is in the root and FURLs are working fine.

                      Also, do you know what’s happening when the url is changed but the page isn’t found? Which part of this is not working? Is it Apache, Modx config, ht.access?

                      Just trying to be smarter about this stuff.

                      Terry
                        www.terrybarthdesign.com

                      This discussion is closed to further replies. Keep calm and carry on.