Jump to content

Dynamic Mod Rewrite


onlyican

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/100508-dynamic-mod-rewrite/
Share on other sites

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).

Link to comment
https://forums.phpfreaks.com/topic/100508-dynamic-mod-rewrite/#findComment-514020
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.