TheSky Posted June 16, 2011 Share Posted June 16, 2011 is there some way to make index.php?id=example to /example like there is new folder Quote Link to comment https://forums.phpfreaks.com/topic/239512-indexphpidexample-to-example/ Share on other sites More sharing options...
TheSky Posted June 16, 2011 Author Share Posted June 16, 2011 any ideas ? Quote Link to comment https://forums.phpfreaks.com/topic/239512-indexphpidexample-to-example/#findComment-1230356 Share on other sites More sharing options...
gristoi Posted June 16, 2011 Share Posted June 16, 2011 I presume you are talking about using clean urls. To do this you will need to ensure your server has the mod rewrite module enabled. Then all you need to do is add or alter your existing .htaccess file to allow for the modification: add these into the .htaccess: RewriteEngine On RewriteRule ^([a-z]+)/([a-z\-]+)$ /$1/$2.php [L] hope that helps get you started Quote Link to comment https://forums.phpfreaks.com/topic/239512-indexphpidexample-to-example/#findComment-1230365 Share on other sites More sharing options...
delickate Posted June 16, 2011 Share Posted June 16, 2011 You can do it using .httaccess file place in root directory by writing the following commands RewriteEngine On RewriteRule ^([a-z]+)/([a-z\-]+)$ /$1/$2.php [L] Quote Link to comment https://forums.phpfreaks.com/topic/239512-indexphpidexample-to-example/#findComment-1230380 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.