Links reset to wrong location

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
simon1206
New Member
New Member
Posts: 6
Joined: Mon Apr 07, 2008 9:43 pm

Links reset to wrong location

Post by simon1206 »

I installed cmsmadesimple under a separate directory that I map with a directive. 
When I create a local link to another page on the same webserver and save it, the initial try
link works

Scenario:

Apache setting
Alias /cms /home/path_to_cms/cms123

Added link Link

But when I tried to edit the content again, the link defaults to
../path_outside_cms/  which indicates it is under the /home/path_to_cms/cms123 directory.

Even when I edit and save the link to ../../path_outside_cms and save, submit, subsequent edit
of that link will default to ../path_outside_cms which is wrong.

I am using pretty_url, no .htaccess in the cms123 directory.

This is very annoying

Help appreciated
Simon
simon1206
New Member
New Member
Posts: 6
Joined: Mon Apr 07, 2008 9:43 pm

Re: Links reset to wrong location

Post by simon1206 »

There is a work around on this, but I really think it is a bug and ought to be fixed.

The work around in case your cms installation is not at Apache docroot and you are referring a path outside the
cms installation:

use this syntax for links:

http://servername:80/path
or http://servername:443/path

It seems that when the servername: is given cms will not try to simplify the path (which it does errorneously
when the path is outside cms installation.

Here's my path settings:
#-------------
#Path Settings
#-------------

#Document root as seen from the webserver.  No slash at the end
#If page is requested with https use https as root url
#e.g. http://blah.com
$config['root_url'] = 'http://appserver1/cms';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}

#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/home/simon/PROG/cms-1.2.3';

#Name of the admin directory
$config['admin_dir'] = 'admin';

#Where do previews get stored temporarily?  It defaults to tmp/cache.
$config['previews_path'] = '/home/simon/PROG/cms-1.2.3/tmp/cache';

#Where are uploaded files put?  This defaults to uploads.
$config['uploads_path'] = '/home/simon/PROG/cms-1.2.3/uploads';

#Where is the url to this uploads directory?
$config['uploads_url'] = $config['root_url'] . '/uploads';

Simon
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Links reset to wrong location

Post by Dr.CSS »

Your paths show a little diff. than all of my installs, the root has no calls the rest of them have...

#e.g. http://blah.com
$config['root_url'] = 'http://multiintech.com/cmsms4';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}

#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/homepages/24/d151200904/htdocs/cmsms4';

#Name of the admin directory
$config['admin_dir'] = 'admin';

#Where do previews get stored temporarily?  It defaults to tmp/cache.
$config['previews_path'] = '/homepages/24/d151200904/htdocs/cmsms4/tmp/cache';

#Where are uploaded files put?  This defaults to uploads.
$config['uploads_path'] = '/homepages/24/d151200904/htdocs/cmsms4/uploads';

#Where is the url to this uploads directory?
$config['uploads_url'] = $config['root_url'] . '/uploads';
Post Reply

Return to “CMSMS Core”