PDA

View Full Version : Moving site from within a subfolder


jellis09
02-03-2012, 02:44 PM
I built my site in a subfolder (e.g. www.something.com/community) and now I am ready to move it into production (e.g. www.something.com). I copied all of the files and updated the two values in the admin settings that referenced my old to the new url. My problem is that my CSS and Javascipt files are still referencing the old URL.

Any ideas?

kh99
02-03-2012, 03:16 PM
I think the paths for those should be relative. What do you have under "Site Name / URL / Contact Details" for Forum URL and Always use Forum URL as Base Path?

jellis09
02-03-2012, 03:51 PM
The forum URL is http://www.somthing.com (which is correct)
Always use Forum URL as Base Path is set to YES

kh99
02-03-2012, 03:52 PM
Hmm...OK, when you view the html source for a page, is the <base> tag correct?

jellis09
02-03-2012, 05:16 PM
No it is not.

kh99
02-03-2012, 07:43 PM
Well, I don't know then. There's this function (in class_core.php) to determine the path for the <base> tag:

function fetch_basepath($rel_modifier = false)
{
if ($this->registry->basepath != '')
{
return $this->registry->basepath;
}

if ($this->registry->options['bburl_basepath'])
{
$basepath = trim($this->registry->options['bburl'], '/\\') . '/';
}
else
{
$basepath = VB_URL_BASE_PATH;
}

return $basepath = $basepath . ($rel_modifier ? $this->xss_clean($rel_modifier) : '');
}



so I believe if you have "Always use Forum URL as Base Path" set to Yes then it should use the Forum URL set in the option above that.

Did you change databases when you moved up a level? Do you have any sort of chaching going on?

jellis09
02-06-2012, 01:54 PM
Ok so now I am stumped. I modified this function to return my correct url (www.something.com) and it worked. Now the site displays and functions properly. But obviously this is not the correct answer. I did trace the problem back to $this->registry->options['bburl'] returning the incorrect url. I assume that this is pulling the value directly out of the vb_settings table for the field bburl. But this has the correct value which is not being returned by this function.

Any ideas?

kh99
02-06-2012, 02:14 PM
The settings are cached in the datastore db table, but that should be rebuilt whenever you edit any setting. Maybe something's going wrong with that.

Oh...I think it's possible to set caching to use other than the db, like files. I suppose it's possible that you have it set to use the file system and the cache files don't have the correct permissions.

jellis09
02-07-2012, 01:16 PM
That was the problem. I wrote a script to update the fields in the cache and it worked. You'd think there would be a magic button somewhere to refresh the cache?

Jon