We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26388
    • 103 Posts
    Hopefully someone can help with my trouble getting the FRULs to work. Here is a summary of my system setup:

    Os X Server 10.4.8
    Apache 1.3.33
    PHP 4.4.4
    MySQL (whatever version comes stock . .can’t remember exactly)

    Modx 0.9.5 (with sample site installed)

    http://dev.kiron-design.com/modx/

    I’ve setup modx in a subdirectory called, originally enough, "modx" subsequently edited the .htaccess file to reflect that:

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


    Upon enabling FURLs in modx, the urls are getting rewritten properly. However, I get 404 not found errors returned back to me.

    Not Found
    The requested URL /modx/features.html was not found on this server.
    
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/1.3.33 Server at dev.kiron-design.com Port 80
    


    Any ideas? I’m stumped. huh huh I’ve done everything the doc’s have said to do yet it still is not working.
      • 22303 MODX Staff
      • 10,725 Posts
      Are you sure you renamed your ht.access file to .htaccess? And have you tried RewriteBase /modx/ (note the trailing slash)? You can also change the RewriteRule to ^(.*)$ /modx/index.php?q=$1 [L,QSA]... just some ideas
        • 25663 MODX Staff
        • 12,272 Posts
        I don’t think the built in OS X Apache supports mod_rewrite out of the box, which is required for FURLs to work.

        A quick Google turns this up to get it to work.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I love MAMP... you can use php4 or php5 as you prefer, it’s all in one nice neat location, and they are really good at keeping up to date.
            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
            • 26388
            • 103 Posts
            Quote from: rthrash at Jan 30, 2007, 12:32 AM

            I don’t think the built in OS X Apache supports mod_rewrite out of the box, which is required for FURLs to work.

            A quick Google turns this up to get it to work.

            mod_rewrite is on and it is rewriting the links (urls) but not finding anything hence the 404 error. Also, I have tried the trailing slash in the RewriteBase /modx/ as well as incorporating the directory path in the RewriteRule and both had the same result. I’ll check out that google link posted above. One thing to note, my brother has also installed modx on his server, same system however he is running php5, mysql 5 and apache 2.0 . . . he didn’t experience any issue. Could there be a versioning issue on my system?

            ht.access has been renamed as well . .
              • 22303 MODX Staff
              • 10,725 Posts
              MODx does the rewriting of URL’s internally. The fact that those URLs are not then translated to the proper internal MODx URL by mod_rewrite tells me that it is not enabled or working for some reason.
                • 26388
                • 103 Posts
                Quote from: OpenGeek at Jan 30, 2007, 10:55 AM

                MODx does the rewriting of URL’s internally. The fact that those URLs are not then translated to the proper internal MODx URL by mod_rewrite tells me that it is not enabled or working for some reason.

                ahh, got it. it’s turned on. tried modifying the httpd.conf file for AllowOverride All and in the conf file for the virtual site to no avail. so it’s something with the way mod_rewrite is enabled on OS X Server’s install of apache you think? The module is enabled so I don’t quite understand . . grr
                  • 30223
                  • 1,010 Posts
                  Try temporarily adding this to your .htaccess:
                  RewriteLog "/path/to/a/text/file/rewrite.log";
                  RewriteLogLevel 1 
                  


                  This will write a log of the rewriting process and should give you an idea of what’s happening behind the scene. You can set the RewriteLogLevel to anything between 0 - 9 where 0 turns logging off and increasing numbers give you more an more detail. Be careful though to turn it off again asap as it can cause significant performance losses (and the log file will grow quite rapidly in size) especially with higher log levels.
                    • 26388
                    • 103 Posts
                    Quote from: TobyL at Jan 30, 2007, 12:53 PM

                    Try temporarily adding this to your .htaccess:
                    RewriteLog "/path/to/a/text/file/rewrite.log";
                    RewriteLogLevel 1 
                    


                    This will write a log of the rewriting process and should give you an idea of what’s happening behind the scene. You can set the RewriteLogLevel to anything between 0 - 9 where 0 turns logging off and increasing numbers give you more an more detail. Be careful though to turn it off again asap as it can cause significant performance losses (and the log file will grow quite rapidly in size) especially with higher log levels.

                    There must be something wrong with my .htaccess file . . . I didn’t have any luck adding that code to the file for logging of what’s going on . . . come to think of it, I’ve experimented putting different directory paths in the RewriteBase to see what it would do. I still got 404 errors but the path in the error always shows the proper directory path. In other words:

                    RewriteBase /modx

                    RewriteBase /whatever

                    still gets me a 404 error with the path being http://domeain.com/modx/aliasname.html

                    In therory, or at least this is what I assume, if you change that path in the RewriteBase directive, shouldn’t that reflect in the 404 error if the .htaccess file was working properly?
                      • 19986
                      • 90 Posts
                      If it’s telling you that it can’t find /modx/features.html then it’s not doing the rewrite properly. You can test that mod_rewrite is working by redirecting your site somewhere else with this rule:

                      RewriteRule ^(.*)$ http://www.google.com [R]


                      If that redirects to google then mod_rewrite is working.

                      If it’s working, try slimming down the .htaccess file. Remove the following for starters:

                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      

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