1
sim_suin
Simplified URLs Hack
  • 2005/1/18 3:59

  • sim_suin

  • Just popping in

  • Posts: 10

  • Since: 2005/1/13


This hack Simplified URLs ,which is based on ShotURLs released by reynaldo, converts XOOPS URLs into shorter and static ones that can be indexed by search engines.

Search engines like Google do not crawl the URLs which contain parameters, like “…*.php?abc=1&xyz=2….”. In spite of this truth, almost all of URLs in XOOPS include parameters. This hack solves such a problem at once by converting all dynamic URLs into static ones.
Quote:

Quote reynaldo's words;
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.

For this reason, this hack gives you shallow URLs. For example ;

[Default] http://xoops_site/modules/news/article.php?storyid=1
[Converted] http://xoops_site/news+article.storyid+1.htm

[Default] http://xoops_site/modules/userinfo.php?uid=1
[Converted] http://xoops_site/userinfo.uid+1.html

I checked this hack in Xoops2.0.9.X and 2.0.6.
This probably runs in the other versions.
I also checked more than 30 modules so I think it is available for most of the modules. Yet errors must exist in this hack. When you find some bugs or errors, please let me know.

Finally I'm sorry for my poor English and I appreciate reynaldo who developed ShortURLs.

You can download HERE >>> Simplified URLs 1.1

How to Install
1) Modify your loadpages.php.
Set your start module's dir name at line 33.
If you don't set a start module, please set it blank like: $start_module = "";
Set the position of "loadpages.php" at line 38.

2) Upload this two files to your XOOPS root dir:
- loadpages.php
- simplified_url.php

3) 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.

4) In the XOOPS root dir, there is a file named mainfile.php
Open it and add the following line just after the disclaimer (line 41 for
Xoops 2.09):
include "simplified_url.php";

It must be put under "XOOPS_URL"
ex :
39:define('XOOPS_URL''http://localhost/');
40:
41:include "simplified_url.php";
42:
43:define('XOOPS_CHECK_PATH'0);

5) Save mainfile.php and upload it to your server.

2
tl
Re: Simplified URLs Hack
  • 2005/1/19 0:20

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


It worked for the modules. I like your idea of removing "m-" and the "." in "+.html"

It seems you have two versions of html.

Under admin, it is xxx.html
under modules, it is yyy.htm

It does not work well if you were to navigate through module admin and want to go back to system admin. The hack would transform systme admin to "system-admin.htm" which does not work under your hack. Only system-admin.html would work. Any reasons of using two extensions?

Thanks for the hack.

BTW, your site looks great.

3
sim_suin
Re: Simplified URLs Hack
  • 2005/1/19 3:15

  • sim_suin

  • Just popping in

  • Posts: 10

  • Since: 2005/1/13


Quote:

tl wrote:
It seems you have two versions of html.

Under admin, it is xxx.html
under modules, it is yyy.htm

The difference between “htm” and “html” has a clear meaning.
Under the root directory of Xoops, “html” is assigned to the URL.
Under modules’ directory, “htm” is assigned.

For example,
http://xoops-site/register.php changes into
http://xoops-site/register.html
http://xoops-site/modules/news/index.php changes into
http://xoops-site/news+index.htm
Of course http://xoops-site/admin.php changes into
http://xoops-site/admin.html

This hack distinguishes between root directory and modules directory with those extensions.
Quote:

It does not work well if you were to navigate through module admin and want to go back to system admin. The hack would transform systme admin to "system-admin.htm" which does not work under your hack. Only system-admin.html would work. Any reasons of using two extensions?

This hack does not convert the URLs of admin pages.
There are two reasons.
First reason is that clawlers do not clawl there. You need not convert URLs at such pages.
Secound reason is that if you had errors there, you could not manage your site or you would have to remove this hack.
This hack does not work there to manage the contents safely.

But if you want to let it work, please change "simplified_url.php" like follows
Change
if(  ( !preg_match("//modules/([^/]*)/admin//"$_SERVER['SCRIPT_NAME']) ) 
  && ( !
preg_match("//modules/system//"$_SERVER['SCRIPT_NAME']) )
  && ( !
preg_match("/admin.php/"$_SERVER['SCRIPT_NAME']) )  ) {
    
//ob_start('ob_gzhandler');
    //ob_start('absolutize');
    
ob_start('simplify_urls');
}

into
//ob_start('ob_gzhandler');
    //ob_start('absolutize');
    
ob_start('simplify_urls');


Quote:

It worked for the modules. I like your idea of removing "m-" and the "." in "+.html"
BTW, your site looks great.

thank you

4
Herko
Re: Simplified URLs Hack
  • 2005/1/19 7:23

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Quote:

sim_suin wrote:
Search engines like Google do not crawl the URLs which contain parameters, like “…*.php?abc=1&xyz=2….”. In spite of this truth, almost all of URLs in XOOPS include parameters.


This has been discussed here before, but this fact is a myth. That doesn't mean that your hack isn't valuable and good tho but let me explain:

Quote:

Myth #8: Google Will Not Index Dynamic Pages

Some search engines have, in the past, had problems with dynamic pages, that is, pages that use a query string. This was not due to any technical limitation, but rather, because search engines knew that it was possible to create a set of an infinite amount of dynamic pages, or they could create an endless loop. In either case, the search engines did not want their crawlers to be caught spidering endless numbers of dynamically generated pages.

Google is a newer search engine, and has never had a problem with query strings. However, some dynamic pages can still throw Google for a loop.

Some shopping carts or forums store session information in the URL when cookies are unable to be written. This effectively kills search engines like Google because search engines key their indexes with URLs, and when you put session information in the URL, that URL will change constantly. This is especially true as Google uses multiple IP addresses to crawl the Web, so each crawler will see a different URL on your site, which basically results in those pages not being listed. It is important that if you use such software, you amend it so that if cookies are unable to be written, the software simply does not track session information.

So, you don't need to use search engine-friendly URLs to be listed in Google. However, these URLs do have other benefits, such as hiding what server side technology you use (so that you may change it seamlessly later), and they are more people-friendly. Additionally, while Google can spider dynamic pages, it may limit the amount of dynamic pages it spiders from one particular site. Your best bet for a good ranking is to use search-engine friendly URLs.
(source: SitePoints Top 10 Google myths revealved)


Herko

5
sim_suin
Re: Simplified URLs Hack
  • 2005/1/19 9:02

  • sim_suin

  • Just popping in

  • Posts: 10

  • Since: 2005/1/13


Quote:

Herko Coomans wrote:
Quote:

sim_suin wrote:
Search engines like Google do not crawl the URLs which contain parameters, like “…*.php?abc=1&xyz=2….”. In spite of this truth, almost all of URLs in XOOPS include parameters.


This has been discussed here before, but this fact is a myth.

That is partly right. Actually, Google index the URLs which have a few parameters. As Google is intelligent, it can do so. But this hack is not only for Google.

Have you visited Google directory,Amazon.com and Yahoo!?
Why do you think these famous sites convert URLs?
I do not know a correct answer because I am not intersted in SEO, but these sites know the answer.

6
chrometuna
Re: Simplified URLs Hack
  • 2005/1/19 9:05

  • chrometuna

  • Just popping in

  • Posts: 67

  • Since: 2004/7/24


Wow! This seems to work great on my site so far!

http://www.topekadiy.com

Now I am currious to see if my search rankings start going up?

Now here is a question that I should probably sugest in the module requests forum:

I have seen sites that have a "make shorter url" form such as:
http://punk-list.org/
(Thats not a XOOPS site)

Or http://notlong.com/
I am sure there are hundreds of these kinds of url forwarding sites.

But what about a module that does this that we could use on our sites? It would give the user a simple form, allow them to paste in an url, and get a much shorter url back out of it.

Anyway, thanks for the hack!

Cheers
tuna

7
Mithrandir
Re: Simplified URLs Hack

Quote:
Have you visited Google directory,Amazon.com and Yahoo!?
Why do you think these famous sites convert URLs?

My main guess is that it looks nicer.

8
sim_suin
Re: Simplified URLs Hack
  • 2005/1/19 9:24

  • sim_suin

  • Just popping in

  • Posts: 10

  • Since: 2005/1/13


Quote:

Mithrandir wrote:
Quote:
Have you visited Google directory,Amazon.com and Yahoo!?
Why do you think these famous sites convert URLs?

My main guess is that it looks nicer.

That is a interesting answer.
I wish Xoops's URLs would be also nicer like Google Directory.[size=x-small](>_<+)[/size]

9
carnuke
Re: Simplified URLs Hack
  • 2005/1/19 9:30

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


Google has always been able to index pages like
http://houseofstrauss.co.uk/modules/wfsection/article.php?articleid=126 as checking your referers will prove. However, I have never seen other search engines index these sort of addresses. Is it the content? No, I have an ordinary html site with identical content that had several sarch engines index the same content. Even the site hirachy wa similar.

So whats the difference. I can only deduce it is exactly as reported that many SEs will not index pages through query strings.

Here is the real probelem: I used The shortURL hack by Reynaldo for many months and resubmitted my site to a whole list of SEs. There was absolutely no difference to my site Search engine popularity, even with the hack 'on'

So, I remain convinceed that Google will 'go where others fear to tread', but skeptical that these hacks really work for other SE access.

I would like someone to demonstrate with some referer logs a clear 'before' and 'after' results.

10
ClubNUKE
Re: Simplified URLs Hack
  • 2005/1/19 13:46

  • ClubNUKE

  • Just popping in

  • Posts: 83

  • Since: 2004/9/1 2


I have problem with wfdownload when I try to download a file.

Quote:
Error: refer path is not from the same place..

Login

Who's Online

229 user(s) are online (70 user(s) are browsing Support Forums)


Members: 0


Guests: 229


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