We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22108
    • 39 Posts
    I had 963 in the webroot and installed Evo 1.0.0 in a subdirectory. Each installation has its own database. I am experiencing problems with friendly URLs in the Evo installation. For example when I try to access the login page by .../subdir/Login.html, a 404 error is generated and is captured by the 963 installation. But when I access the same page with .../subdir/index.php?id=6 it works fine.

    Is there a way to fix this problem? I appreciate your help.
      • 26931
      • 2,314 Posts
      Hi OldGuru,
      in your .htaccess try adding "subdir" to the rewrite base
      #Options +FollowSymlinks
      RewriteEngine On
      RewriteBase /subdir

      + clear the MODx cache
        • 21257 MODX Staff
        • 730 Posts
        A couple of alternatives, if you’re going to use just one .htaccess file in the web root to do rewriting for both sites, would be one of the following modifications:

        ...
        # For Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^subdir\/(.*)$ subdir/index.php?q=$1 [L,QSA]
        
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        ...
        


        , or to be more compact (with the caveat that I haven’t tried this rule so it might be a bit off)

        ...
        # For Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(subdir\/)?(.*)$ $1index.php?q=$2 [L,QSA]
        ...
        

          Mike Schell
          Lead Developer, MODX Cloud
          Email: [email protected]
          GitHub: https://github.com/netProphET/
          Twitter: @mkschell
          • 22108
          • 39 Posts
          Thanks sharkbait and netprophet. I’m gonna try your modifications and let you know how it goes.
            • 22108
            • 39 Posts
            Quote from: netProphET at Oct 16, 2009, 12:48 PM

            ...
            # For Friendly URLs
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^subdir\/(.*)$ subdir/index.php?q=$1 [L,QSA]
            
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
            ...
            

            I tried the above and both installations work like a charm.

            Thanks again guys!
              • 22108
              • 39 Posts
              Apart from solving the friendly URL problem it also makes sure the proper installation handles the 404 error.