We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13287
    • 4 Posts
    Hello,
    I have a modx site in the root of my site and another application (activeCollab) in a subdirectory of my site, both CMS and app are completely independent of each other.

    dev.mydomain.com -- my cms site
    dev.mydomain.com/app -- my other app

    The problem im having is that i want to have friendly URLs working on my app, and it seems to work (as i see the clean urls in the address bar), but i get a modx 404 page when i try to access a page within the app. I suspect there is some conflicts with both the modx and app’s htaccess file.

    Can someone who is more knowledgable with htaccess show me how to make modx play well with other apps?

    Here is modx’s friend url related htaccess:

    #Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    
    # 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]
    
    


    Here is the other app’s htacess file, within the the app’s subdirectory (/app):

    Options -Indexes
    <IfModule mod_rewrite.c>
      RewriteEngine On
    
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^(.+) - [PT,L]
    
      RewriteRule ^projects_icons/(.*)$ public/projects_icons/$1 [L]
      RewriteRule ^avatars/(.*)$ public/avatars/$1 [L]
      RewriteRule ^logos/(.*)$ public/logos/$1 [L]
      RewriteRule ^thumb.php$ public/thumb.php [L]
      RewriteRule ^captcha.php$ public/captcha.php [L]
      RewriteRule ^$ public/index.php [L]
      RewriteRule ^(.*)$ public/index.php?path_info=$1 [L]
    </IfModule>
    


    Thanks


    Edit: also i tried to exclude the app’s folder on this line:

    RewriteRule ^(manager|assets|app) - [L]

    But it still doesnt work...
      • 13287
      • 4 Posts
      No htaccess rockstars here i guess?
        • 13287
        • 4 Posts
        Hm, thanks. But it didnt work. I now just get an Internal Server Error page anywhere i try to navigate in the CMS...

        :(
          • 6228
          • 249 Posts
          Try adding the following line after the RewriteEngine On declaration (in the app .ht file):

          RewriteBase /app

            lo9on.com

            MODx Evolution/Revolution | Remote Desktop Training | Development
            • 13287
            • 4 Posts
            Quote from: cyclissmo at Jun 02, 2010, 11:17 PM

            Try adding the following line after the RewriteEngine On declaration (in the app .ht file):

            RewriteBase /app



            YES!!! That did it! Thanks so much!