Page 1 of 1

[SOLVED] Trying to install CMSMS to a sub-folder

Posted: Tue Jul 30, 2013 11:13 am
by wmdvanzyl
Hi all.

I am trying to install CMSMS to a subfolder on a server where there is already a CMSMS installtion in the root dircetory. Is this possible?

CMSMS version 1.11.7

Domain: http://www.modh.co.za

Trying to install another instance in http://www.modh.co.za/test

After that i will use the subdomain http://test.modh.co.za that points to the test folder.

I hastily slapped an under construction page on there, but ignore that. Looking at the /test path we see that the URL of the CSS is wrong.

Any idea why?

Re: Trying to install CMSMS to a sub-folder

Posted: Tue Jul 30, 2013 5:11 pm
by Dr.CSS
You have something strange going on with your canonical settings or something as it gives double web address to links...

<link rel="canonical" href="www.modh.co.za/test/" />
<title>Home | CMS Made Simple Test Site</title>
<base href="www.modh.co.za/test/" />

http://www.modh.co.za/test/www.modh.co. ... msms-works

Re: Trying to install CMSMS to a sub-folder

Posted: Tue Jul 30, 2013 6:21 pm
by velden
I've sometimes issues too on specific hosting using subdomains.

In this case I'd suggest setting the root_url in config.php

$config['root_url'] = 'http://test.modh.co.za/';

The url's in your pages' source bare the 'http://' part. I think you might have used the config line, but forgot the protocol part (http://).

Re: Trying to install CMSMS to a sub-folder

Posted: Wed Jul 31, 2013 8:24 am
by wmdvanzyl
Will investigate - thanks!

Re: Trying to install CMSMS to a sub-folder

Posted: Wed Jul 31, 2013 8:39 am
by wmdvanzyl
velden wrote:I've sometimes issues too on specific hosting using subdomains.

In this case I'd suggest setting the root_url in config.php

$config['root_url'] = 'http://test.modh.co.za/';

The url's in your pages' source bare the 'http://' part. I think you might have used the config line, but forgot the protocol part (http://).
Well that helped! Let me see what works now and what doesn't. Not perfect yet, but clearly made a difference. Is this just related to installations in subdirectories?

Re: Trying to install CMSMS to a sub-folder

Posted: Wed Jul 31, 2013 8:46 am
by velden
Most of the times it seems to work. I guess it depends on the way the hosting provider sets things up regarding sub domains.

Most of the times it works out of the box (without adding the root_url in config).

Are you sure you added: http://test.modh.co.za/ because it seems like http://www.modh.co.za/test

Re: Trying to install CMSMS to a sub-folder

Posted: Wed Jul 31, 2013 8:53 am
by wmdvanzyl
velden wrote:Most of the times it seems to work. I guess it depends on the way the hosting provider sets things up regarding sub domains.

Most of the times it works out of the box (without adding the root_url in config).

Are you sure you added: http://test.modh.co.za/ because it seems like http://www.modh.co.za/test
Well right now i am just trying to get it to work on http://www.modh.co.za/test - one problem at a time right. Will try and get the subdomain element of it solved later. ATM using that subfolder still gives me issues. The css is correctly found now, but none of the images are resolving. I have checked the paths using firebug and the paths are correct! So it could be a permissions thing? I dunno...

EDIT: I've gone ahead and set up a subdomain and i get exactly the same result. Changed config.php to test.modh.co.za

EDIT: I do see however that using the root_url path test.modh.co.za/ gives a better result, but causes the path to read test.modh.co.za// This might have something to do with images not loading... For instance: trying to access test.modh.co.za/admin redirects to test.modh.co.za//admin/login.php

Re: Trying to install CMSMS to a sub-folder

Posted: Wed Jul 31, 2013 9:06 am
by velden
When changing things like that first clear cache: Admin -> System Maintenance I think.

The permissions (403 error) I don't understand. Maybe ask your hosting provider?

Re: Trying to install CMSMS to a sub-folder

Posted: Wed Jul 31, 2013 9:14 am
by wmdvanzyl
velden wrote:When changing things like that first clear cache: Admin -> System Maintenance I think.

The permissions (403 error) I don't understand. Maybe ask your hosting provider?
I no longer think it is a permissions issue. It is simply a slash being added somewhere. I can even access the backend now. I logged in and lceared the cache just in case.

Trying to access

Code: Select all

test.modh.co.za/admin
redirects to

Code: Select all

test.modh.co.za//admin/login.php
Note the two slashes. It works, but i am guessing that it doesn't work for the images.

EDIT: Back to square one. Removed trailing slash from root_url and resolved double slashes situation. Still no images.

Re: Trying to install CMSMS to a sub-folder

Posted: Wed Jul 31, 2013 10:47 am
by velden
I'm sorry about the trailing slash in root_url config. Copy-pasted it from my browser.

All the images give a http error 403 Forbidden.

I don't know where that comes from. Never had it myself, so I guess it's something host-specific.

You haven't been playing around with .htaccess files?

Re: Trying to install CMSMS to a sub-folder

Posted: Wed Jul 31, 2013 8:24 pm
by wmdvanzyl
Oh i understand now what you mean with the 403 error. Well at least we have an handle on what the problem is. I have just disallowed indexing of the directory, but that shouldn't do anything. Hold on - let me check the .htaccess of the root. I remember doing stuff in there a while back...

EDIT: You sir are a gentleman! I completely forgot of .htaccess file in the root directory. Had this in there:

Code: Select all

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^http://modh.co.za/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://modh.co.za$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.modh.co.za/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.modh.co.za$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
Any guesses why the images wouldn't show?! :P Commented it out, works like a charm. :)