Install CMSMS in a subdir and still use www.mydomain.com
Posted: Tue Jan 15, 2013 12:02 pm
This took a bit of research as is not my area BUT I got it working, ie install CMSMS in a sub directory and still access it using a 'TLD', top level domain name.
Firstly, install CMSMS as normal in a sub directory, eg:
using the default htaccess.txt file renamed to .htaccess.
You'll now be able to access the site using "http://www.mydomain.com/cms".
Next, create an .htaccess file in the ROOT directory that contains:
What this does is force the domain name to be prefixed by www - needed for admin functions and stylesheets.
It then rewrites the URL to "http://www.mydomain.com" and points to the 'cms' directory.
I'm sure there are many other solutions but my research in this forum came up with lots of broken links. Just putting it out there for anyone who wants it.
Hope this helps
psy
Firstly, install CMSMS as normal in a sub directory, eg:
Code: Select all
http://www.mydomain.com/cms
You'll now be able to access the site using "http://www.mydomain.com/cms".
Next, create an .htaccess file in the ROOT directory that contains:
Code: Select all
# force www IN URL
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
# END force www IN URL
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule !^cms(/?|/.+)$ /cms%{REQUEST_URI} [L]
What this does is force the domain name to be prefixed by www - needed for admin functions and stylesheets.
It then rewrites the URL to "http://www.mydomain.com" and points to the 'cms' directory.
I'm sure there are many other solutions but my research in this forum came up with lots of broken links. Just putting it out there for anyone who wants it.
Hope this helps
psy