Forum Moderators: phranque
How should i write mod_rewrite code for the following -
I want my url to look like this -
<a href=http://www.test.com/soccer/name/sweety>
<a href=http://www.test.com/soccer/name/john>
The name 'sweety' and 'john' each will change according to the link clicked. Like if someone click on link '1' the url_window should show 'sweety' and when someone click on link '2' the url_window should show 'john'
if($id==1)
{
echo "one";
}
if($id==2)
{
echo "two";
}
echo "
<a href=http://www.test.com/soccer/name?id=1>1</a>
<a href=http://www.test.com/soccer/name?id=2>2</a>
";
Thanks
HS
Along with clean urls i want my urls to be user friendly also so that then can directly type the url containing their name and can directly go to their page ...like
www.test.com/soccer/name/john
The code which i am writing is as follows
if(id==1)
{
do bla bla..
}
<a href=$PHP_SELF?id=1>John</a>
Now what should be the mod_rewrite code
HS
yourphp.php?cat=soccer&name=john
whenever a user asks for
www.test.com/soccer/name/john
yourphp.php should then query your soccer database to find out whether there is someone called john.
<a href=$PHP_SELF?id=1>John</a>