UPDATE
I found a solution as IIRF
. please read the accepted answer
I haven't worked with Windows Server / IIS before and thus I am finding it a little difficult to deal with it. I even don't know if both of them are the same thing.
The scenario is like this:
I have two versions of one site, a .com one for PC viewers, a .mobi one for mobile phones. I want to redirect all the mobile phone (smartphone) user coming to .com site to .mobi site. I'll be using wurfl for detecting the accessing device's type, and all of this stuff works pretty fine with the php script I wrote.
Since the home page of the site is a plain html, I can't use any PHP script in it.
I also can't change the page to a PHP script since default.htm
is needed by the SEO guys, I don't know why.
I was wishing to have web.config
(or anything else) written the way that it rewrites all the URL requests coming to default.htm
to default.php
where I can make the detector script work, and this script further decides where to send the user.
I don't know anything about web.config
, I just found out that its similar to .htaccess
Please tell me something about it. The server has various sites and its only one site that we would want to have this functionality. Should I put the web.config
inside the folder of this particular site?
UPDATE
I found out by the answers and the comments that web.config
works only with the ASP.NET applications while I don't have any ASP.NET environment set at the server.
I also can't use the IIS URLRewrite module since its works with IIS7+ and I have IIS 6.0.
Is there any way out?
A
web.config
file is a configuration file for an ASP.NET application. Given you don't appear to be running an ASP.NET app, you probably don't want this.I think what you're trying to do is possible within the IIS URLWrite module, given that that can issue redirects based on conditionals, such as the useragent containing certain strings and the presence of particular headers.
I'd do some research into the URLRewrite module (it's a separate download for IIS I think).
Since I couldn't use
web.config
as ASP.NET wasn't configured on the concerned server, and sinceIIS URLRewrite
module only on the IIS version 7 and above, I had to find a solution which could get me something similar to whatISAPI_Rewrite
engine and still be free/less costly, I foundIIRF
to be my solution.I tried it on my Windows XP running IIS6.0, and after spending a little bit of time with it, I could get what I wanted.
You might also want to check
IIRF
our here. It's free and Open Source solution to URL Rewriting requirements on IIS