User Login    
 + Register
  • Main navigation
Login
Username:

Password:


Lost Password?

Register now!
Documentation
Who's Online
89 user(s) are online (9 user(s) are browsing XoopsWiki)

Members: 2
Guests: 87

caek9, roktec, more...
[Main Page]

Dev:Abbreviated XOOPS URL

From XOOPS Project

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy
Category: Development

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?

old_x2_c.jpg Use something like this. remove the host (and port if any) portion :-)

new_x2_c.jpg And you should ignore this warning and proceed

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.

back to dev:Main Page

Retrieved from "http://www.xoops.org/modules/mediawiki/index.php/Dev:Abbreviated_XOOPS_URL"

This page has been accessed 345 times. This page was last modified 01:56, 16 December 2007. Content is available under XOOPS Project.


Local Support Sites
Powered by
XOOPS Code hosted on SourceForge

Powered by PHP



Powered by MySQL

Powered by Smarty

OSI certified

All content on this site is subject to the Creative Commons License
Developers for Hire