How can I implement url routing with PHP + IIS?

I wrote a content switcher script that uses dynamic urls to pass parameters that indicate what data to send.

For example, to view a page about the page you type: http://www.example.com/?page=about

The problem is that it is not user-friendly, especially in my case where users will not necessarily be able to access this page from a link from the home page.

I would prefer if the url looks like this: http://www.example.com/about/

Unfortunately, I am running PHP5 on IIS platform, not Apache, so this removes the most common mod-rewrite methods.

I am looking for examples on how to do URL routing using PHP + IIS.

Can I do this on IIS 7.5 platform?

+2


source to share


3 answers


Since you are using IIS 7, you can use the new rewrite support that is now available.



Take a look at http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module

+6


source


IIRF is a rewrite filter that works with IIS (5,6,7, 7.5) and uses a configuration syntax that is like mod_rewrite.

Since you are using IIS7.5, you can also use Microsoft's rewrite module.



Both of them work great with PHP.

+1


source


Have a look at ISAPI Rewrite .

0


source







All Articles