We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7327
    • 195 Posts
    Hi Guys,

    I’m using MODx Evolution 1.0.2 with a localhost XAMPP installation (April 2009 1.7.1 Beta5 version based on the xampp-changes.txt file - using PHP Version 5.2.9). I’m having issues with the Friendly URL feature. I’ve followed the official wiki on this matter by setting the .htaccess file (used the default provided and tweaked it a bit) and have made sure Allow Override is set to all in <directory /> portion of the apache/conf/httpd.conf file. I’ve also set up the friendly URL feature in the MODx configuration/tools window. The weird part is, it partly works. The following should illustrate what works and what doesn’t:

    http://localhost/modx/index.html?q=front-page.html
    RESULT: WORKS FINE

    http://localhost/modx/index.html?q=events.html
    RESULT: WORKS FINE

    http://localhost/modx/events/index.html?q=article-name.html
    RESULT: DOES NOT WORK. It throws me back to http://localhost/xampp (the default xampp landing page)

    My Modx install is in a directory in the htdocs dir: xampp/htdocs/MODXINSTALL/

    The following is in my .htaccess file (located inside the MODXINSTALL directory) right now:

    # For full documentation and other suggested options, please see
    # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
    # including for unexpected logouts in multi-server/cloud environments
    # and especially for the first three commented out rules
    
    php_flag register_globals Off
    AddDefaultCharset utf-8
    php_value date.timezone Asia/Singapore
    
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    
    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]
    
    # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
    #RewriteCond %{HTTP_HOST} .
    #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
    #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    
    # Exclude /assets and /manager directories from rewrite rules
    RewriteRule ^(manager|assets) - [L]
    
    # For Friendly URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
    
    # Reduce server overhead by enabling output compression if supported.
    php_flag zlib.output_compression On
    php_value zlib.output_compression_level 7
    


    Has anyone else encountered this? Can anyone help me on this matter? Thanks in advance! laugh


    EDIT: I’ve tried out changing the RewriteBase value from / to /modx - and now it throws me to the homepage of my modx installation rather than the xampp landing page. It’s a start, but it the links to the actual articles still don’t work sad.



    EDIT 2: I’ve disabled the following SEF URL features: Use Friendly URL alias path and the Allow duplicate URL aliases and while the nice alias paths are now gone, the links to the articles now work. Anyone know what could be causing this?
      • 3749
      • 24,544 Posts
      Try adding a slash to the end of the RewriteBase:

      RewriteBase /modx/


      Also, double-check to make sure that mod_rewrite is enabled in XAMPP (it’s off by default).
        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
        • 7327
        • 195 Posts
        Hey Bob,

        Thanks for the quick reply. Nope, the trailing slash at the end didn’t work sad. And yep, mod_rewrite is enabled (I checked out phpinfo() - loaded modules section). Could this be just an Apache issue? I’m guessing if I threw this site on let’s say Dreamhost, I think friendly URLs should work like a charm..


        Edit: I’ve changed my RewriteBase from / to /modxinstall/ and added that path to the RewriteRule section. Here’s another weird thing. With the Use Friendly URL alias path and Allow duplicate URL aliases turned off, the links WITH THE ADDITIONAL PATH FORMATTING works! If I turn on Use Friendly URL aliases, the links with the additional path formatting stops working! huh
          • 3749
          • 24,544 Posts
          That path should be in the RewriteBase or the rule, but not both.
            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