Better Site Management
Better Site Management using Abbreviated XOOPS_URL
Benefits
1. Easy to have local test/qa environment (no bounce back to live domain). 2. Mirror the live site for experimenting without screwing up live site. 3. Running multiple site with same content with DNS parking ?Multiple domain site using cPanel. 4. Decrease output by few % (most urls are abbreviated with no schema/host/port) hence minimizing your bandwidth usage.
How to do it on the new site?
Fix the xoops-2.0.9.2 distribution with following code
File "include/checklogin.php" line #82
$url = xoops_getenv('HTTP_HOST').trim($_POST['xoops_redirect']);
will change to
$url .= xoops_getenv('HTTP_HOST').trim($_POST['xoops_redirect']);
And in file "include/functions.php" line #137
Comment following 3 lines
if (strpos($ref, XOOPS_URL) !== 0 ) {
return false;
}
and add these 4 lines
$pref = parse_url($ref);
if (strpos( $_SERVER['HTTP_HOST'], $pref['host']) !== 0) {
return false;
}
Note:
1. Database columns will not be populated with site specific full url. Easy to import-export across environments. 2. You may face problems with some modules where module author re-wrote xoops_refcheck in their code base :-/
Proceed with install? You remember the regular install screen?
http://xoops.biz/dist/abvrurl/old_x2_c.jpg Use something like this. remove the host (and port if any) portion
http://xoops.biz/dist/abvrurl/new_x2_c.jpg And you should ignore this warning and proceed
http://xoops.biz/dist/abvrurl/warn_x2_c.jpg Done
Now export the database and files and import on any machine (change the mainfile.php a little to match your environment), it should work fine without sticking to some domain. How to do it on my existing site?
to be done
Cheers, Sudhaker Raj sudhaker at yahoo dot com Site: http://xoops.biz/
Last modified: 30.03.07 by GibaPhp











![[Main Page]](/modules/mediawiki/images/mediawiki.png)


