Reputation: 20644
I am hosting a php application on my virtual Windows server running IIS.
The person who wrote the php website for me asked me to put this piece of codes in a .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
But as this application is running on IIS, I need to translate this piece of codes to web.config. How can I translate them into web.config?
Upvotes: 3
Views: 540
Reputation: 318518
What this htaccess code does is redirecting any requests which would otherwise result in a 404 error (!-f and !-d mean "file does not exist" and "dir does not exist") to /index.php.
IIS7 has a feature to import mod_rewrite rules - simply use this:
(Source)
Upvotes: 3