onlyican Posted April 10, 2008 Share Posted April 10, 2008 Been working in ASP and VFP (Visual FoxPro) for a while now and forgot loads of PHP I am building a CMS driven site (in PHP) I am allowing the user to add / edit / remove pages I dont like pages like ?page=1 So I want to edit the .htaccess file so I can have the page name redirect to the page id /ThisPage IS TO /index.php?page=3 Off course, Security reasons, I do not want to re-write my .htaccess file as this means changing chmods which is dangerous There is a way of doing this PHP but I forgot, can someone remind me please. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/100508-dynamic-mod-rewrite/ Share on other sites More sharing options...
GingerRobot Posted April 10, 2008 Share Posted April 10, 2008 It is possible to achieve something similar by parsing the $_SERVER['QUERY_STRING'] variable. However, there are limitations and mod rewriting is much more powerful. Quote Link to comment https://forums.phpfreaks.com/topic/100508-dynamic-mod-rewrite/#findComment-514011 Share on other sites More sharing options...
wildteen88 Posted April 10, 2008 Share Posted April 10, 2008 I dont like pages like ?page=1 So I want to edit the .htaccess file so I can have the page name redirect to the page id /ThisPage IS TO /index.php?page=3 Off course, Security reasons, I do not want to re-write my .htaccess file as this means changing chmods which is dangerous You wont need to to alter your chmod permissions for mod_rewrite to work. However this can be archived using just PHP too, however you wont be able to hide the file name from the url, if you do it with PHP you're url's can only be like: mysite.com/index.php/SomePageName/PageNumber/something_else With mod_rewrite you can hide the filename (index.php). Quote Link to comment https://forums.phpfreaks.com/topic/100508-dynamic-mod-rewrite/#findComment-514020 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.