Jump to content

Rewriting


Boxerman

Recommended Posts

Hi all,

 

Currently using IIS7 and im trying to rewrite my script but im confused.

 

i want news.php?id=* turned into /news/title-stored-in-database/

 

but i have no idea about rewriting and on the IIS website its all a little too confusing.

 

Can someone point me the right way please

Link to comment
Share on other sites

I think you're thinking about this backward.  Inbound links will be in the format of www.yoursite.com/12345-The-Article-Title-Here

 

Your rewrite rule will ignore the title entirely and just use the ID (12345 in this case).  Your rewrite rules cannot access the database.  You would print out links to your site in the "pretty" format and then the rule takes the pretty format, strips out everything but the ID, and uses it.

 

-Dan

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.