[geeklog-devtalk] RE topic.php and url conformity

mike at fuckingbrit.com mike at fuckingbrit.com
Thu Dec 23 04:07:36 EST 2004


--
I made a copy of index.php and borrowed code from various files, and =
created a topic.php. If you look at my site you'll observe that when =
clicking on a topic link, instead of getting =
/index.php?topic=3Danti-spam, you'll get /topic.php/anti-spam. Not only =
does this optimize my search engine results for that keyword, but I =
think it organizes the sections a little better as it now is treated =
like a directory. With additional tweaks I'm also using the section =
name as my title tag. I've updated all the code to generate the proper =
links to use it.
--

Not to be a pain, but, you could acheive this without the topic.php file as
follows (using .htaccesss):

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule topic/(.*)$ /index.php?topic=$1
RewriteRule .* - [F]
</IfModule>

I do this with my articles:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule article.php/(.*)$ /article.php?story=$1
RewriteRule article/(.*)$ /article.php?story=$1
RewriteRule .* - [F]
</IfModule>


Currently the second format isn't working on my site, since I haven't got
round to editing the link generation since the 1.3.10 upgrade and I don't
see the point in doing it again until the 1.3.11 final release, but, with
my site I had it writing the links as
http://www.fuckingbrit.com/article/sid

instead of
http://www.fuckingbrit.com/article.php/sid

Worked nicely. I still have the rewrite rule in .htaccess for the cached
links in google etc, but I haven't tweaked it to write those articles out
again. I had to add the first rewrite rule for article.php/ because the
re-writing in geeklog wasn't working for me.

Mike

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .





More information about the geeklog-devtalk mailing list