How do I get my php websites using .htaccess files to do basic URL re-writing to work on new windows server?

I have just bought a new Windows server with IIS on it and plesk panel. Good times (I thought...)

I have about 10 client sites that run on PHP which shouldn't be a problem. But I can't seem to get an answer from my hosting provider on how to get my .htaccess working on the windows server so I'm getting stung for two lots of hosting and don't know the best way forward.

How do i get my .htaccess rewriting working on windows?

EDIT I have installed the IIS version 2 of their rewrite module and tried to convert my .htaccess file into a web.config set of rules.

Now my very basic site which uses the zend framework shows a 404 for the homepage (90% of the time) and the other pages to display the site but they all show the homepage.

Any ideas or has anyone had similar problems?

Will post the rules I'm using shortly and the old .htaccess file that used to work.

.htaccess file from linux setup

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Windows version

<rewrite>
  <rules>
    <rule name="Imported Rule 1" stopProcessing="true">
      <match url="^.*$" />
      <conditions logicalGrouping="MatchAny">
        <add input="{REQUEST_FILENAME}" matchType="IsFile"  />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory"  />
      </conditions>
      <action type="None" />
    </rule>
    <rule name="Imported Rule 2" stopProcessing="true">
      <match url="^.*$" />
      <action type="Rewrite" url="index.php" />
    </rule>
  </rules>
</rewrite>

Answers


.htaccess files are specific to the Apache web server. They're not going to do a thing on IIS.

You'll need to convert them to a format IIS understands. Here's a tutorial.


Need Your Help

Navigation Bar in Navigation Controller Subview Initializes to Wrong Location (even though it fixes itself)

ios uinavigationcontroller initialization uinavigationbar render

I am using custom Tab View Controller (implemented via UITabBarDelegate) and a Navigation Controller within it as a subview. In order to get the Navigation Controller's Navigation Bar to appear be...

ContextConfiguration inheritance in junit

spring junit easymock

I am trying to mock a service thats fetch data from redis.I have injected the beans in spring context in a new context file test-context.xml But I have other contexts files A.xml,B.xml which refere...