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.

Aman Alam
  • 149
  • 1
  • 7

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
  • 553
  • 3
  • 12
  • I just configured IIS on a Windows XP machine to test things out. I have my mobile device detection mechanism working perfectly, would just want to do the above. I just try your solution out and revert – Aman Alam Apr 04 '11 at 06:28
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
  • I have found the solution with IIRF. see it here: http://serverfault.com/questions/254495/redirecting-with-web-config/257210#257210 – Aman Alam Jul 11 '11 at 04:55