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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.