HOME TIPS FORUMS DOWNLOADS
   »»  Tips Archive |
Page (1) 2 3 4 »
Tricks/Tools : A Little Guide of Using ShortURL
Posted by tl001 on 2004/11/11 8:37:27 (10928 reads)
Tricks/Tools

Reynaldo Alvarez's ShortURL hack DOES work, but there are a few of glitches using it with Xoops. The problem is related to how the hack treats relative links and how the developers had coded their Xoops modules.

To make the hack fully operationable, you must be willing to make some changes to various module files. This little guide is intended to serve as "pointers", so you can follow and make the required change easily.



Requirement


In addition to the basic ReWrite requirement, your host company MUST have set session.trans_sid off in PHP.

PHP with session.use_trans_sid set will always add a unique PHPSESSID query pair to URLs if cookies are rejected (search engines do not accept cookies). While session.use_trans_sid helps users who do not accept cookies, but search engines will likely rank your sites low.

Why? Your sites may be considered as mirroring itself when search engines crawled your sites with the same URL appended with different session IDs. They may see that you are attempting to assign several URLs to the exactly same pages/contents, as a result, search engines may lower your rank or even ban your site altogether. And this will totally defeat the purpose of using the hack at the first place. So please make sure you don't have the session.trans_sid option set in your php.

A simple phpinfo() will provide you the information. You can disable that feature via a .htaccess file or directly from PHP code.

In the .htaccess file, you can add the following line:
php_flag session.use_trans_sid off

And in PHP code:
file: include/common.php
locate
session_start();
add
ini_set("url_rewriter.tags","");
before session_start();

If your PHP is compiled as Apache module, .htaccess will not work as the PHP master value will overwrite your local value. Only the second method will work, as it is a runtime modifier.

Make sure it works even you have made the necessary changes. Remove the hack if your URLs are still being appended with PHPSESSIDs.

Page (1) 2 3 4 »
Printer Friendly Page Send this Story to a Friend
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread
kapsat
Posted: 2005/9/29 13:35  Updated: 2005/9/29 14:59
Just popping in
Joined: 2005/9/29
From: New Orleans
Posts: 8
 Re: A Little Guide of Using ShortURL
Hi, I have a question just to be sure i am ok with what i have.

I am running version 2.2.2 and it is a brand new site. I have the hack instaled and all seems fine, but the urls do not have all "-" it shows "+" also.

example - /m-articles+index+cat_id-1.html

Do you see this as being any problem?

I was also thinking i did not need to worry about the SE's hitting 404's hack because they have not indexed this site yet.

About the session id's
I called my host to check this and they said that it was set to (1) i assume that meant it was (on) to use session id's so i told them to set it to (0)

Was i correct in this. Before i installed the short urls hack i did not see any session id's in the url... Is that because my browser expts cookies?

dave
tl001
Posted: 2005/9/29 15:18  Updated: 2005/9/29 15:35
Webmaster
Joined: 2004/6/10
From:
Posts: 282
 Re: A Little Guide of Using ShortURL
Quote:
About the session id's
I called my host to check this and they said that it was set to (1) i assume that meant it was (on) to use session id's so i told them to set it to (0)


you are correct, it should set to 0
session.use_trans_sid = 0

If you are running a brand new site, you may want to consider running it under 2.0.13 as 2.2 branch has been downgraded by Xoops for now.

You may want to try SimplifiedURLs instead of the ShortURLs - it could save you great deal of headaches in module admin.

[edit]
Quote:

example - /m-articles+index+cat_id-1.html

you don't need to worry about the +'s and -'s

"m-" is an indicator telling loadpage.php what module to look for
"+" "+" bracket tells loadpage what script to load
Other -'s are the script parameters.

In your case, loadpage will look for the articles module and a script called index.php with a parameter cat_id=1

The loadpage would translate back to
/modules/articles/index.php?cat_id=1

[/edit]
kapsat
Posted: 2005/9/29 19:21  Updated: 2005/9/29 19:21
Just popping in
Joined: 2005/9/29
From: New Orleans
Posts: 8
 Re: A Little Guide of Using ShortURL
Quote:
If you are running a brand new site, you may want to consider running it under 2.0.13 as 2.2 branch has been downgraded by Xoops for now.


Well... A couple day's ago when i found xoops i downloaded 2.2.3 and found it was buggy. Then i went back a noticed it said not for a production site. So at the advise of someone on the xoops site last night i did try the 2.0.13, but it seemed as if i went back in time. So i then started over again and installed 2.2.2 and as far as i can tell everything seems fine.

Do you know of any spacific bugs or why 2.2 has been downgraded?

By simplified urls do you mean the standard urls with out the rewrite?

Off topic - hope you don't mind.
What module or script gives you the
Quote:
(0.288 seconds | 30 queries)

at the bottom of your page?

Also what version of xoops are you running here and elswhere?

BTW, nice site.

Thanks,
dave
tl001
Posted: 2005/9/29 20:08  Updated: 2005/9/29 20:08
Webmaster
Joined: 2004/6/10
From:
Posts: 282
 Re: A Little Guide of Using ShortURL
Quote:

Do you know of any spacific bugs or why 2.2 has been downgraded?


The following is a quote by skalpa
Quote:

Development methodology:
- As of the first version (2.3.0), this branch will get instantaneously the level of stability and compatibility of XOOPS 2.0.13. The explanation is extremely simple: we will "go back in time" and will use the 2.0.13 codebase to work (which will be more practical and quick than to modify or repair some parts of 2.2).
... ...

You may want to read the whole article to get a full understanding of the future development of 2.X branch of Xoops.
http://www.xoops.org/modules/news/article.php?storyid=2602

Based on my understanding upgrading from 2.2 to 2.3 is possible. You should be okay for running 2.2 for now.


Quote:

By simplified urls do you mean the standard urls with out the rewrite?

Suin developed SimplifiedURLs from ShortURLs, so they have the same philosophy but with different implementation methods. BTW, this site runs on SimplifiedURLs and you will notice the difference on how the URLs are transformed. You can find a bit more info at
http://xoops-tips.com/news-article.storyid-73.htm

Quote:

What module or script gives you the
Quote:

(0.288 seconds | 30 queries)

at the bottom of your page?

it is a smarty variable developed by brash. You can find it
http://www.xoops.org/modules/news/article.php?storyid=2489
and
http://www.xoops.org/modules/news/article.php?storyid=1862

Quote:

Also what version of xoops are you running here and elswhere?

Xoops 2.0.13.1. Many Xoops users are facing a hard decision - either to continue to use Xoops original or use a new forked version, Xoopscube. The forked version actually is being developed by the original developer of Xoops.

Quote:

BTW, nice site.

Thank you!