In a nutshell, I want my entire MODX installation to be accessible
only from
https://REMOVED.net (the root of the domain) instead of
https://REMOVED.net/cms/.
This is what my web root looks like:
drwxr-xr-x cgi-bin/
drwxr-xr-x cms/ <- MODX
+ drwxr-xr-x cms/modx <- Core
+ drwxr-xr-x cms/modxadmin <- Manager
drwxr-xr-x forums/ <- XenForo
drwxr-xr-x wiki/ <- MediaWiki
-rw-r--r-- .htaccess
-rw-r--r-- robots.txt
After trying incessantly for around five hours, I gave up, did a clean install of 2.2.9-pl advanced, and reset my .htaccess files to a cleaner slate. Does anyone here have any idea as to how I can get this to work? The furthest I got was having the MODX front end accessible both with and without "/cms/" in the URL, and the back end accessible only with "/cms/" in theURL.
.htaccess in public_html (webroot):
Options -Indexes -MultiViews +FollowSymLinks
RewriteEngine On
# Remove www prefix
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} ^www.REMOVED.net$ [NC]
RewriteRule ^(.*)$ https://REMOVED.net/$1 [R,L]
# Force SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://REMOVED.net/$1 [R,L]
# Friendly URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
# Output compression
php_flag zlib.output_compression On
php_value zlib.output_compression_level 5
# Other stuff
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
BrowserMatch "MSIE" brokenvary=1
BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
BrowserMatch "Opera" !brokenvary
SetEnvIf brokenvary 1 force-no-vary
.htaccess in public_html/cms:
Options -Indexes -MultiViews +FollowSymLinks
RewriteEngine On
# Set web root
RewriteBase /cms
# Friendly URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
# Output compression
php_flag zlib.output_compression On
php_value zlib.output_compression_level 5
Other info:
- MODX Version: 2.2.9-pl (advanced)
- PHP Version: 5.4.19
- Database (MySQL, SQL Server, etc) Version: 5.5.32-cll - MySQL Community Server (GPL)
- Additional Server Info: Apache 2.4.6
- Installed MODX Add-ons: CodeMirror
[ed. note: euro_coding_simulator_2012 last edited this post 13 years ago.]