View Single Post
Old 11-27-2009, 05:56 PM  
Tamashi
Confirmed User
 
Tamashi's Avatar
 
Join Date: Oct 2009
Location: 565-013-936
Posts: 728
TGPX Users, want more SEO friendly gallery URLS like Smart Thumbs? Look here!

Hey Hey

If you've been using the TGPX software by JMB Soft then you know the generated gallery URL's don't always look too pretty. After investigating a couple of website who are using Smart Thumbs, I thought I'd look for a way to get Smart-Thumbs-like SEO-friendly URLS. It took some time, but got it figured together with Jemery after half-stealing the Smart Thumbs codes. This rewrite is also perfectly working with the Click.php script.

Requirements:
- mod_rewrite enabled on your server
- possibly a text editor
- 5 minutes of your time instead of watching porn

So Yeah, how?
First we'll start off by making a change in your TGP templates. Completely remove your old gallery URL code, and replace it by:
Code:
<a href="gallery/{$gallery.description|strtolower|treplace_special::'-'}.html?id={$gallery.gallery_id|urlencode}&u={$gallery.gallery_url|urlencode}" target="_blank">
Great, the url's look cool, but I'm getting a 404 Not Found error? The next step is adding one line to your htaccess file, which is supposed to be in every directory that contains tgp pages:

Code:
RewriteRule ^gallery/(.*)$ http://www.yoursite.com/tgpx/click.php?%{QUERY_STRING}
BUT MY CLICK SCRIPT DOES NOT WORK!
Code:
Replace http://www.yoursite.com/tgpx/click.php in your .htaccess file with the full URL to the click.php script on your server.
You're done :-)
__________________
++ SIGNATURE FOR SALE ++
ICQ: 565-013-936
Tamashi is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook