Page 1 of 1
[SOLVED]Issue with setting my URL Path via config
Posted: Tue May 21, 2013 3:38 pm
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
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!
Re: Issue with setting my URL Path via config
Posted: Tue May 21, 2013 3:39 pm
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.
Re: Issue with setting my URL Path via config
Posted: Tue May 21, 2013 3:55 pm
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.
Re: Issue with setting my URL Path via config
Posted: Tue May 21, 2013 4:00 pm
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';
Re: Issue with setting my URL Path via config
Posted: Tue May 21, 2013 4:21 pm
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!
Re: [SOLVED]Issue with setting my URL Path via config
Posted: Tue May 21, 2013 4:43 pm
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.
Re: [SOLVED]Issue with setting my URL Path via config
Posted: Tue May 21, 2013 5:05 pm
by Jos
calguy1000 wrote:use caution, as some modules may have improperly hardcoded paths
As for example
Gallery... have to fix that sometime
