Forum Moderators: phranque
I am making clean and friendly urls with help of mod_rewrite rule
I want the following url
http://www.example.com/testing/soccer.php?id=1
to change into this
http://www.example.com/testing/soccer/page1
The code of my .htaccess and soccer file is follows
CODE OF .HTTACCESS FILE
RewriteEngine On
RewriteRule ^soccer/([a-zA-Z]+)([0-9]+)/? soccer.php?id=$2 [L]
CODE OF MY SOCCER FILE
if($id==1)
{
echo "bla bla";
}
if($id==2)
{
echo "blee blee";
}
echo "<p> <a href=soccer/page1/>1</a>
<p> <a href=soccer/page2/>2</a>";
Though the code is working fine but you will see the problem in the url_window when you click on link '1' or link '2' two times. (It keeps on adding 'scoccer/page1' to url everytime)
How should i avoid this?
And secondly, is the code execution in the soccer file is ok
Thanks for help
HS
[edited by: jdMorgan at 6:15 pm (utc) on Jan. 14, 2004]
[edit reason] No site specifics, please [/edit]