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

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
User avatar
Phoenix
Forum Members
Forum Members
Posts: 19
Joined: Mon Jul 14, 2008 9:53 am

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

Post 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';
Last edited by Phoenix on Sun Feb 21, 2010 1:48 pm, edited 1 time in total.
dcleckley
Forum Members
Forum Members
Posts: 127
Joined: Fri Mar 06, 2009 2:13 pm

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

Post 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?
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am

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

Post 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
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
User avatar
kidcardboard
Forum Members
Forum Members
Posts: 54
Joined: Mon Sep 28, 2009 5:25 pm

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

Post 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
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm

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

Post 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
Locked

Return to “[locked] Installation, Setup and Upgrade”