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.
-
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]
...
Thanks sharkbait and netprophet. I’m gonna try your modifications and let you know how it goes.
Apart from solving the friendly URL problem it also makes sure the proper installation handles the 404 error.