0

I do have a similar question posted on Server Fault.

Still, I want to explore various ways by which one can effectively redirect traffic coming to a Windows Server. Is it possible that I have a index.php file but let the URL to it be index.htm? On apache, I could do this with mod-rewrite, but I am not sure how to do this on a Windows Server.

I am currently reading about named a 3rd party module ISAPI_Rewrite. But has anyone of you come across any similar situation? If yes, can you please show me the way to do it?

Sorry I am a complete noob with Windows Server, so I am going to require a little extra effort from all of you guys.

2 Answers2

0

For redirection of all requests, you can do this in IIS. Runt inetmgr in Windows 2008 to open the IIS Manager, and select the web site. Then, in Features View you will see under IIS a button called HTTP Redirect.

There is another button for selecting default document, so if you want it to be index.php, you can do that here.

For redirecting mobile users, have a look at this post about IIS rewrite rule.

Nils Magne Lunde
  • 563
  • 3
  • 13
0

In ISAPI_Rewrite the following code will create 301-redirect to virtual .html file and rewrite back to .php

RewriteEngine on
RewriteBase /

RewriteRule index\.php$ /index.html [NC,R=301,L]
Rewriterule index\.html$ /index.php [NC,L]
Andrew
  • 116