After taking a deep look at some modules out there, I decided to write ShortUrls from scratch and slightly change the way it work.
I added
'dynamic' support for other modules so you don't have to wait for me to release a version of the hack supporting your favorite module. This have a lot of advantages but may also have a few drawbacks I may be unware of.
I also corrected a few errors the previous version had with comments and some images, and made it possible for the hack to work if you are running XOOPS from inside a dir.
Download it here:
http://www.wtmmail.com/XoopsShortUrls/ShortURLs_0.3_for_Xoops.zip--------------------------------------------------------------------------------------
The way this hack now works is by converting urls like:http://www.domain.com/modules/youfavmodule/yourfavscript.phpinto
http://www.domain.com/yourfavmodule-yourfavscript.htmlArguments are also converted, so for example:http://www.domain.com/modules/newbb/viewtopic.php?viewmode=thread&topic_id=1&forum=1&move=prev&topic_time=1077888891becomes:http://www.domain.com/newbb-viewtopic-viewmode-thread-topic_id-1-forum-1-move-prev-topic_time-1077888891.htmlAs you can see, the later is a fully indexable url. This means even your forums will get indexed!!!
As before, I tested this hack and found it perfectly working,
BUT:* If you find an error, I relay on you reporting it here so I can correct it.
* I recommend you to test your site throughfully after applying this hack to be sure everything is working.
What can you do if something is not working as expected?- Open loadpage.php
- Set $is_debug to 1 ($is_debug = 1;). This will turn on debug functionality and will report what loadpage is trying to do.
- Refresh your site, View Source and send me what you see there, at the top, before the normal HTML begins.
How to install it?It would be good if you read through the Readme file, but here are the quick instructions:
--------------------------------
1) Upload xoops_shorturls.php and loadpage.php into your XOOPS root dir.
2) Edit your .htaccess file and add the lines found in the .htaccess file I provided. If you are upgrading from a previous version, overwrite the lines you added by previous versions.
3) Edit mainfile.php somewhere around line 27, right before
if ( !defined("XOOPS_MAINFILE_INCLUDED") )
Add the following:
include "xoops_shorturls.php";
It's important that you edit the mainfile.php at your site, not the one you may be have in your hard disk, as they are different.4) If your homepage is set to a module other than News, open loadpage.php and edit line #20
$defaultmodule = "news";
Where it says "news" change it to your default module directory name, for example:
$defaultmodule = "mydownloads";
Open your site and if it is working correctly, almost all URLs should be converted to a Search Engine frienly version.
I can't stress enough how important it is you report errors you may encounter.
Enjoy it!