Here we go!
The original idea came from GIJOE - a well-known XOOPS master. Click
here to see it. It's really a magical piece of codes. All you want to do is add 8 lines of PHP codes into the very beginning of your mainfile.php then add 1 lines to your XOOPS_ROOT_PATH/.htaccess
GIJOE's method is safe for almost (all) of XOOPS modules.
The idea then came to nobunobu - another great XOOPS master who created SysUtils/cubeUtils (Autologin hack and Multi-language utility), SysUtils for XOOPS and cubeUtils for
XOOPS Cube Legacy. GIJOE said nobunobu's cubeUtils is the first one in the XOOPS history that can beat his 'Easiest MultiLanguage Hack'.
Nobunobu made XOOPS URLs even more good looking - you cannot figure-out that one site is powered by XOOPS just by looking into its URLs!!
OK, now back to the topic.
Requirements- XOOPS runs on Apache web server with mod_rewrite loaded and .htaccess available.
- You are not XOOPS newbies
- You have experience dealing with Apache's mod_rewrite and PHP language
- You have to solve problem yourself if this does not work with some modules
Successfully tested XOOPS cores/modules- XOOPS 2.0.16a-JP
-
XOOPS Cube Legacy 2.1.4
- XOOPS 2.0.18.1
- XOOPS 2.2.6
- XOOPS 2.3.0-apha2
- XOOPS Mexico
- Simple-Xoops 0.8.2
- Impress.CMS 1.0 Final (Janus)
- Modules: d3forum, d3downloads, d3xcgal, xsns, pico, mylinks, Xigg, news, Xpress, SmartFAQ, Xwords, Liaise, other custom modules
Limitations- This method described here is not an universal for every XOOPS modules. It may not work on some modules, xoopspoll for example.
- This may not work on some Apache RootDirectory which are configed as 'aliases'
- This may not work on XOOPS_URL different from ones like
http://www.mysite.com, for example
http://www.mysite.com/xoops- Some functions of a module may not work, for example 'Print' function of the pico module
How toSuppose that what you want to change is as following (4 modules, 1 javascript, 1 stylesheet):
Before: XOOPS_URL/modules/Xigg
After: XOOPS_URL/news
Before: XOOPS_URL/modules/xsns
After: XOOPS_URL/sns
Before: XOOPS_URL/modules/d3downloads
After: XOOPS_URL/stuffs
Before: XOOPS_URL/modules/mylinks
After: XOOPS_URL/links
Before: XOOPS_URL/xoops.css
After: XOOPS_URL/main.css
Before: XOOPS_URL/include/xoops.js
After: XOOPS_URL/include/main.js
First, add to your .htaccess file under XOOPS_ROOT_PATH so that it will look like this RewriteEngine on
RewriteRule ^news/(.*)$ /modules/Xigg/$1 [L]
RewriteRule ^sns/(.*)$ /modules/xsns/$1 [L]
RewriteRule ^stuffs/(.*)$ /modules/d3downloads/$1 [L]
RewriteRule ^links/(.*)$ /modules/mylinks/$1 [L]
RewriteRule ^main.css$ /xoops.css [L]
RewriteRule ^include/main.js$ /include/xoops.js [L]
Finally, add to your mainfile.php under XOOPS_ROOT_PATH so that it will look like this
// Available for download shortly
// Sorry, I deleted the codes because
// it changed when pasting here
ConclusionsDemos for above works here:
- XOOPS demos:
http://www.nhatban.net/info/a0021.html- Our site (in Vietnamse):
http://www.nhatban.netOriginal works here (in Japanese):
http://www.kowa.org/modules/yybbs/viewbbs.php?bbs_id=4&serial=2164Thanks to GIJOE and nobunobu for their great idea and implementation.
Cheers!!