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

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
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

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

Post 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?
Last edited by wmdvanzyl on Wed Jul 31, 2013 8:37 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Trying to install CMSMS to a sub-folder

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Trying to install CMSMS to a sub-folder

Post 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://).
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

Re: Trying to install CMSMS to a sub-folder

Post by wmdvanzyl »

Will investigate - thanks!
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

Re: Trying to install CMSMS to a sub-folder

Post 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?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Trying to install CMSMS to a sub-folder

Post 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
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

Re: Trying to install CMSMS to a sub-folder

Post 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
Last edited by wmdvanzyl on Wed Jul 31, 2013 9:11 am, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Trying to install CMSMS to a sub-folder

Post 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?
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

Re: Trying to install CMSMS to a sub-folder

Post 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.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Trying to install CMSMS to a sub-folder

Post 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?
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

Re: Trying to install CMSMS to a sub-folder

Post 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. :)
Locked

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