[SOLVED]Issue with setting my URL Path via config

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

[SOLVED]Issue with setting my URL Path via config

Post by blackhawk »

I would like to change the uploads directory name to something else. I read the PDF documentation that comes with the cmsms package for 1.11.6, but I am running into a technical challange. The system is not updating the paths correctly.

I renamed my uploads folder to

Code: Select all

uploadsdemo
My config.php file looks like this...

Code: Select all

$config['root_url'].'/uploadsdemo';
...
...
...
$config['url_rewriting'] = 'mod_rewrite';


I then cleared the cache and template_c directory

I then refreshed my cmsms page, and my local server is generated the following error...
[Tue May 21 11:27:27.674800 2013] [:error] [pid 5572:tid 1716] [client 127.0...] PHP Notice: Undefined index: root_url in C:\\UniServer\\vhosts\\mdt\\dev\\config.php on line 4
I don't know what else to check....I simply want to rename the uploads folder. Any help will be great.

Thanks!
Last edited by blackhawk on Tue May 21, 2013 4:22 pm, edited 2 times in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Issue with setting my URL Path via config

Post by calguy1000 »

Why are you changing the root_url when you really want to change the uploads_path and uploads_url config entries. They are documented in the document too.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

Re: Issue with setting my URL Path via config

Post by blackhawk »

That's what I thought too, after my confusion...but same problem. I get the same kind of error message. Within my console tab for developer tools, the path to one of my scripts is still ..../uploads/....
and I am using the {uploads_url} tag in front of it, within the admin.

even when I set the following in my config.php file...

Code: Select all

$config['uploads_path'].'/uploadsdemo';
$config['uploads_url'].'/uploadsdemo';
Also, I am not trying to change the name of my image folder under the uploads directory. I want to change the name of the 'uploads' directory itself.

Thanks for the help so far.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Issue with setting my URL Path via config

Post by calguy1000 »

That is not valid php syntax.

$config['uploads_url'] = $config['root_url'].'/uploadsdemo';
$config['uploads_path'] = $config['root_path'].'/uploadsdemo';

However, I have doubts that that will work directly, because of the way te cms_config class works.

This would work though:

$config['uploads_url'] = 'FULL URL TO UPLOADS DIR';
$config['uploads_path'] = 'ABSOLUTE PATH TO UPLOADS DIR';

if you want to use relative URLS and relative paths for the uploads_url and uploads_path then you will probably have to specify absolute urls and paths for the root_path and root_url config entries.

i.e:
$config['root_path'] = getcwd();
$config['root_url'] = 'ABSOLUTE URL TO SITE';
$config['uploads_path'] = $config['root_path'].'/uploadsdemo';
$config['uploads_url'] = $config['root_url'].'/uploadsdemo';
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

Re: Issue with setting my URL Path via config

Post by blackhawk »

Thank you so much calguy1000, once again you have sharpened my skills and now I have all paths corrected, and no errors in my log files when using your suggested setup for absolute paths.

Thanks!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: [SOLVED]Issue with setting my URL Path via config

Post by calguy1000 »

When changing the uploads path and uploads URL use caution, as some modules may have improperly hardcoded paths to assume that the directory is named 'uploads'. I've run into that a couple of times.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: [SOLVED]Issue with setting my URL Path via config

Post by Jos »

calguy1000 wrote:use caution, as some modules may have improperly hardcoded paths
As for example Gallery... have to fix that sometime :-X
Post Reply

Return to “The Lounge”