1
avtx30
Make Xoops URLs professional
  • 2008/4/20 22:56

  • avtx30

  • Not too shy to talk

  • Posts: 181

  • Since: 2006/10/12


I wanted to get rid of the /modules in every XOOPS URLs. I've searched around and found an interesting article in Japanese about how to do the task.

I will post the 'how to' after translating it into English and doing some tests.

Here are the first results:

/modules/newbb changed to /forum
/modules/news changed to /news
/modules/wordpress changed to /blog
/modules/d3downloads changed to /stuffs
/modules/pico changed to /info
/modules/smartsection changed to /content
/modules/smartfaq changed to /faq
/modules/happy_search changed to /search
/modules/xcgal changed to /photos
/modules/mylinks changed to /links
/modules/liaise changed to /contact
/modules/article changed to /jokes
/xoops.js changed to /main.js
/include/xoops.js changed to /include/main.js

Take a look at these to see some of the changes done:

- http://www.nhatban.net
- http://x2j.nhatban.net/ (for XOOPS 2 JP)
- http://xcl.nhatban.net/ (for XOOPS Cube Legacy)
- http://x20.nhatban.net/ (for Xoops.org 2.0.x)
- http://x22.nhatban.net/ (for Xoops.org 2.2.x)
- http://x23.nhatban.net/ (for Xoops.org 2.3.x)
- http://mexico.nhatban.net/ (for XOOPS Mexico)
- http://simple.nhatban.net/ (for Simple-Xoops)
- http://icms.nhatban.net/ (for i.mpressCMS)

PS. this is posted at other XOOPS forums too

2
trabis
Re: Make Xoops URLs professional
  • 2008/4/20 23:15

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Can you post the original japanese link here? I will learn japanese if i have to! This is very interesting :)

[Edit]
Probably is based in this concept:
http://xoops.peak.ne.jp/md/news/index.php?page=article&storyid=54&easiestml_lang=xlang%3Aen

3
Runeher
Re: Make Xoops URLs professional
  • 2008/4/21 0:48

  • Runeher

  • Module Developer

  • Posts: 825

  • Since: 2008/1/24


Very interesting... Hurry up with that translation!!

4
whooven
Re: Make Xoops URLs professional
  • 2008/4/21 2:41

  • whooven

  • Just popping in

  • Posts: 42

  • Since: 2006/2/17


This is one of my biggest gripes about Xoops. I would love to do this! Thanks for the offer to translate.
"I'm going to see if this internet thing takes off" - someone told me this when I suggested he needed a website.

5
avtx30
Re: Make Xoops URLs professional
  • 2008/4/21 3:38

  • avtx30

  • Not too shy to talk

  • Posts: 181

  • Since: 2006/10/12


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 to
Suppose 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/$[L]  
RewriteRule ^sns/(.*)$ /modules/xsns/$[L]  
RewriteRule ^stuffs/(.*)$ /modules/d3downloads/$[L]  
RewriteRule ^links/(.*)$ /modules/mylinks/$[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


Conclusions

Demos for above works here:
- XOOPS demos: http://www.nhatban.net/info/a0021.html
- Our site (in Vietnamse): http://www.nhatban.net

Original works here (in Japanese):
http://www.kowa.org/modules/yybbs/viewbbs.php?bbs_id=4&serial=2164

Thanks to GIJOE and nobunobu for their great idea and implementation.

Cheers!!

6
kerkyra
Re: Make Xoops URLs professional
  • 2008/4/21 9:17

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


there is a typo error on the mainfile code! i took the original from the jp site but i get a page not found when i click on the module link from the menu! The rewrite engine seems to work fine as it has removed the /modules/ part from the address! running on XOOPS 2.0.18.1. :( running on windows server. I think it would be nice to have the modules part removed from the url in the next release of xoops!
whttp://www.guidemap.gr - Beta is out...

7
avtx30
Re: Make Xoops URLs professional
  • 2008/4/21 9:34

  • avtx30

  • Not too shy to talk

  • Posts: 181

  • Since: 2006/10/12


Thanks for the report.

It seems that some escape characters have been manipulated when saved into xoops.org database. I will make the codes available for download soon.

8
wishcraft
Re: Make Xoops URLs professional

Thats kewl, now thanks to gio my concept of a .htaccess generator module for admin will work nicely, however I want to make it more pungent in the search engine..

For example for CBB I have URLS like so:

For example for the 'Forum Test' the URL can be:

http://www.xoops.asia/forums/Forum-Test/0,1,0,0,100,0,DESC,0

http://www.xoops.asia/forums/Forum-Test/

For the topic test which is installed it is as follows:
http://www.xoops.asia/forums/Forum-Test/Congratulations--The-forum-is-working-/1,1,0,0,0,0,0

http://www.xoops.asia/forums/Forum-Test/Congratulations--The-forum-is-working-/

These means the end users posts will be optimized, but this code will be very useful for making a generic mapper /re mapper for SEO urls..

Still a concept at my desktop..
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

9
Dona_Brasil
Re: Make Xoops URLs professional

Great posting!

Does it lead to duplicate content? Does XOOPS adapt the internal links as well?

Quote:
// Available for download shortly
// Sorry, I deleted the codes because
// it changed when pasting here


It probably works if you switch of XOOPS codes (I posted this problem as a bug on this place)

10
wishcraft
Re: Make Xoops URLs professional

Hmm xooops notices no difference... with mine, but the .htaccess takes more lines than that, as well as making everything move from /modules/.../ to the appropriate path via a 301 Permanently Moved HTTP Header redirection, this sort of redirection leaves no page and also removes pages from search engines.
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

Login

Who's Online

203 user(s) are online (133 user(s) are browsing Support Forums)


Members: 0


Guests: 203


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits