Hello Guys, i have This URL http://website.com/ringtones.php?id=12&name=funny-ringtones I want URL like this http://website.com/12-funny-ringtones.html i have done this work with the help of .htaccess file like this Options +FollowSymLinks RewriteEngine on RewriteRule (.*)-(.*).html ringtones.php?id=$1&name=$2 but when i add another url in same condition and same .htaccess file like this RewriteRule (.*)-(.*).html games.php?id=$1&name=$2 then both are not working properly and showing php errors in webpage Anyone help me that how can i do this ? please reply me Thanks
You are using same url for both conditions... (.*)-(.*).html, will it go to Games section or Ringtones section? You may try giving them both a directory like: RewriteRule ringtones/(.*)-(.*).html ringtones.php?id=$1&name=$2 RewriteRule games/(.*)-(.*).html games.php?id=$1&name=$2 Code (markup):
Hello Mehdi, Thanks for your reply but i don't want to fixed any parameter like ringtones or games i want direct link without any fixed parameter it is possible or not ? please reply me Thanks
Sorry, i dont understand wht u are talking about but if you want Fixed 'ringtones' and 'games' to be variable then try this: RewriteRule (.*)-(.*)-(.*).html $1.php?id=$2&name=$3 Code (markup): It means that if you enter games-01-wohoo.html will be actually games.php?id=01&name=wohoo and if you enter ringtones-01-funny+ringtone.html , will be actually ringtones.php?id=01&name=funny+ringtone hope this is what you are looking for. Thanks
That leaves a huge gap for errors. It would make more sense to have a single file process all of them, and use code in the script to work out the category based on the $_GET['name'] that you send to the script