1
reynaldo
ShortURLs hack
  • 2004/2/14 0:38

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


This is a hack I'm using on my sites to convert XOOPS urls into shorter
urls which can be indexed by Search Engines.

I've found other hacks that do the same but I didn't like the way the worked
because I haven't had good results with urls within deep directorys like:

http://www.domain.com/modules/news/article/1/arg1/arg2

In my experience, some Search Engines (Google for example) didn't like
to crawl pages so "deep" within the site.

This hack uses simpler and shorter urls, for example, instead of

http://www.domain.com/modules/news/article.php?storyid=1279
or
http://www.domain.com/modules/news/article/storyid/1279
you could have:
http://www.domain.com/article1279.html

Right now it shortens urls for the following modules:
News
Userinfo
Submit
Archive
Sections
Xoopspartners

I think those are the more important parts from a XOOPS powered site.
It has been tested on my sites which are being powered by XOOPS 2.06, it
*should* work with other versions too.

You can download it from:
http://www.wtmmail.com/XoopsShortUrls/ShortURLs_0.1_for_Xoops.zip

How to install it?
------------------
Installation is simple:

1) Upload this two files to your XOOPS root dir:
- loadpage.php
- xoops_shorturls.php
2) Modify your .htaccess file, the one you have in your XOOPS root dir (if any)
and add the contents of the included .htaccess file. If you don't have one, just upload the one I provided.

3) In the XOOPS root dir, there is a file named mainfile.php
Open it and add the following line just after the disclaimer (line 27 for
Xoops 2.06):

include "xoops_shorturls.php";

Save mainfile.php and upload it to your server.

IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
You have to edit the mainfile.php that is in your server, not the one that
originally comes with you Xoops, as this file is changed after installation.


After this, open your site. You should have ShorUrls for some of the modules.
I'll be adding support for other modules as I see fit. Please report any errors
or difficulties you may have to this post.


2
Stewdio
Re: ShortURLs hack
  • 2004/2/14 2:32

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


Bookmarked this post for prosperity (too lazy to update)

Nicely done.


3
shivaji
Re: ShortURLs hack
  • 2004/2/14 5:48

  • shivaji

  • Friend of XOOPS

  • Posts: 179

  • Since: 2003/9/18


Hi:

Thanks a lot, I came to know about this thread from sunrapper! I am still running my site on 2.05 :(. I will keep you posted soon i upgrade my site to 2.06.

Thanks again for the excellent information regarding short URL.


4
catalin
Re: ShortURLs hack
  • 2004/2/14 7:02

  • catalin

  • Just popping in

  • Posts: 30

  • Since: 2003/9/4 7


reynaldo ... i am using XOOPS 2.0.3 and the thing with loadpage and xoopsshort.urls works, loads the frontpage but it seems that when i click on the article it loads an error page and in the addres bar it says

/article487.html ( for ex ) but the page does not load, it gives me a NOT FOUND

have any fix for this

i would be in depht if you would help me

the site is http://www.cyber-cup.ro ( the short url is deactivated )

5
carnuke
Re: ShortURLs hack
  • 2004/2/14 7:58

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


Hi reynaldo

I noticed that this is your first post, so welcome to the forums This is an awsome first post!

I just want to say thatnk-you for sharing this important addition to the XOOPS system. I have not yet installed or tried this hack, but it looks very useable. Ultimately it would be required module wide, or at least the major modules as you have already done. I would personally like to see it working for WFsectins as most of my site is built around this. Maybe you can do this in time?

Thanks again Richard

6
reynaldo
Re: ShortURLs hack
  • 2004/2/14 13:04

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


Catalin:

Just to be clear, for this hack to work, it requires Apache to be compiled with the RewriteEngine module.

If this is not your case, check to make sure you uploaded/appended the .htaccess file I included.

I can help you to get the hack working, just let me know the next time you try

7
reynaldo
Re: ShortURLs hack
  • 2004/2/14 13:08

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


Quote:

carnuke wrote:
Hi reynaldo

I noticed that this is your first post, so welcome to the forums This is an awsome first post!


Thanks!

Quote:

I just want to say thatnk-you for sharing this important addition to the XOOPS system.


I just found XOOPS four days ago and I really like the way it works, lightning fast and it is so intuitive. I'm not using it as much as I would like because I would need a multisites CMS

Quote:

I have not yet installed or tried this hack, but it looks very useable. Ultimately it would be required module wide, or at least the major modules as you have already done. I would personally like to see it working for WFsectins as most of my site is built around this. Maybe you can do this in time?


I'll try as soon as I have a few minutes available

Quote:

Thanks again Richard

You're welcome!

8
reynaldo
Re: ShortURLs hack
  • 2004/2/14 13:10

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


Quote:

shivaji wrote:
Hi:

Thanks a lot, I came to know about this thread from sunrapper! I am still running my site on 2.05 :(. I will keep you posted soon i upgrade my site to 2.06.


Shivaji, I didn't say it requires 2.06 to work, I said I tested it on 2.06, and I don't think 2.05 would be too different to 2.06, so maybe you can test it without upgrading.


9
tms_hide
Re: ShortURLs hack
  • 2004/2/14 13:34

  • tms_hide

  • Just popping in

  • Posts: 1

  • Since: 2004/2/14


>>catalin
I was in just same situation.
But, when I turned on "RewriteEngine" and altered .htancess
,I could resolove NOT FOUND error.
This .htancess script is I altered..
# -FrontPage-
[b][color=FF0000]RewriteEngine on [/color][/b]

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

RewriteRule ^topic([0-9]+).htmlloadpage.php [L]

RewriteRule ^article([0-9]+).htmlloadpage.php [L]

RewriteRule ^articles.htmlloadpage.php [L]

RewriteRule ^user([0-9]+).htmlloadpage.php [L]

RewriteRule ^submit.htmlloadpage.php [L]

RewriteRule ^archive.htmlloadpage.php [L]

RewriteRule ^sections.htmlloadpage.php [L]

RewriteRule ^partners.htmlloadpage.php [L]

RewriteRule ^$ loadpage.php [L]

10
reynaldo
Re: ShortURLs hack
  • 2004/2/14 14:02

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


tms_hide:

You are right!
I forgot to include the RewriteEngine on line
I uploaded a corrected version to my server.

Login

Who's Online

238 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 238


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