0

I am working on a PHP-on-IIS site and I want to make dynamic pages which can be accessed by nice URLs. How can I accomplish nice URLs for each user?

To make it more clear to understand I've say users would be stored in database, and user requests page like this: http://www.example.com/user/userusername/info, then PHP script takes that URL and sees "Someone requested info about user 'userusername'." and gives information back. Note script takes 'userusername' as variable.

I don't want you to setup databases and write whole code. I am hoping for answer to "How to make nice url to dynamic page?" I have seen Reference: mod_rewrite, URL rewriting and "pretty links" explained, but how to do that in IIS instead of Apache?

Community
  • 1
  • 1
Karolis
  • 89
  • 10

1 Answers1

0

There is nice detailed post on ISS about Creating Rewrite Rules for the URL Rewrite Module.

In short - to make nice URLs you need to:

  1. Install 'URL Rewrite Module', if you don't have it already.
  2. Under Web Site settings open 'URL Rewrite'.
  3. Add new Blank Rule.
  4. Set 'Requested URL' under 'Match URL' to match Pattern.
  5. Enter pattern which suits you needs. example: ^article/([0-9]+)/([_0-9a-z-]+).
  6. Choose 'Action Type' Rewrite.
  7. And enter original url at 'Rewrite URL'.
  8. Finally click Apply on the right.
  9. Enjoy nice URLs.
Karolis
  • 89
  • 10