Web Hosting Talk







View Full Version : Mod Rewrite or PHP?


BSHbrian
10-02-2002, 08:16 PM
Hi, I'm having difficulty with Mod Rewrite and I am wondering how to change destination url's

for example :

I would like to change

http://www.gamingexpertz.com/index.php?page=cheats

to

http://www.gamingexpertz.com/cheats

and

http://www.gamingexpertz.com/index.php?page=cheats&l=a

to

http://www.gamingexpertz.com/cheats/a


Should I use php or mod rewrite for this? If php, then what kind of coding would I need?

Thanks in Advance!

The Prohacker
10-02-2002, 08:32 PM
<?php

$url_array=explode("/",$REQUEST_URI);
$page=$url_array[0];
$l=$url_array[1];

//Other page content here....

?>


Note: I didn't test the above code... Rewrite is nice, but can mess with things if you use another script that tries to use that path, thats where PHP comes in handy... :D

Falco1199
10-02-2002, 08:37 PM
A little off topic, but I'd just like to say that you could improve your page speed a LOT by using DHTML to display links from a specific letter when you click it's link, rather than linking to a whole new page. If you need, I could give you a code for it.. ;)