Page 1 of 1

[Solved] CMSMS - Install cms in a subdirectory RewriteBase /cms

Posted: Tue Feb 02, 2010 8:51 pm
by Phoenix
The wiki documentation mentions installing cmsms in a subdirectory
RE:
http://forum.cmsmadesimple.org/index.ph ... #msg132606

$config['root_url'] = 'http://mydomain/cms';  =   http://mydomain/cms/index.html
$config['root_url'] = 'http://mydomain';  =   http://mydomain/index.html with no Styling or CSS file


So while most post have all the info two steps are never mentioned
The most common problem ruled out
In the .htaccess
change
RewriteBase /cms/
to
RewriteBase /cms

Assuming you have the following settings in your config file
$config['root_url'] = 'http://mydomain';  

$config['url_rewriting'] = 'mod_rewrite';

$config['page_extension'] = '.html';

You also have this in .htaccess

RewriteBase /cms
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+).html$ index.php?page=$1 [QSA]

Step 1
Where is your .htaccess located ?
It needs to be in the subdirectory  cms  :)

Code: Select all

RewriteBase /cms
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+).html$ index.php?page=$1 [QSA]
Step 2
In the root folder add this to your .htaccess or create a new one adding

Code: Select all

DirectoryIndex index.php index.html
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule !^cms(/?|/.+)$ /cms%{REQUEST_URI} [L]
OR

Try
calguy1000
http://forum.cmsmadesimple.org/index.ph ... 868.0.html

You should find this if you would like to
Install cmsms in a subdirectory
Fix  RewriteBase /cms
Fix Prettly urls
Missing style sheet
Admin area missing style sheet

Added
When using multiple Domains use
$config['root_url'] = 'http://'. $_SERVER['SERVER_NAME'].'/cms';

Re: [Solved] CMSMS - Install cms in a subdirectory RewriteBase /cms

Posted: Sat Feb 13, 2010 5:19 pm
by dcleckley
Question.  I'm running a shared host @ godaddy.  I don't know where to find .htaccess.  I didn't see this file (or folder) in the root of the cms (which is a subdirectory of my root).  Could you enlighten me?

Re: [Solved] CMSMS - Install cms in a subdirectory RewriteBase /cms

Posted: Mon Feb 15, 2010 3:19 am
by fredp
dcleckley wrote: Question.  I'm running a shared host @ godaddy.  I don't know where to find .htaccess.  I didn't see this file (or folder) in the root of the cms (which is a subdirectory of my root).  Could you enlighten me?
You might try the godaddy help pages for this information:  http://help.godaddy.com/search?q=.htaccess

Re: [Solved] CMSMS - Install cms in a subdirectory RewriteBa

Posted: Mon Dec 05, 2011 4:52 pm
by kidcardboard
Hooray for Google indexing. I had a broken module after doing a sub-directory install (everything else seemed to work ok). Just needed to move the pretty url rewriting to the sub .htaccess and change the rewrite base. Haven't added Step 2, but I'll keep that in mind incase anything else starts acting up.

Thanks Phoenix

Re: [Solved] CMSMS - Install cms in a subdirectory RewriteBa

Posted: Mon Dec 05, 2011 5:32 pm
by gianpiero
dcleckley wrote:Question.  I'm running a shared host @ godaddy.  I don't know where to find .htaccess.  I didn't see this file (or folder) in the root of the cms (which is a subdirectory of my root).  Could you enlighten me?
You have to put the .htaccess into the dir of your cmsms
An example is into the folder: doc/htaccess.txt

Some ftp client doesn't show .htaccess file, so if you cannot manage it with ftp then go to the file manager of the CP of webspace

gp