Alternative to Apache.htaccess file for IIS?

I am moving the WordPress blog from Apache to IIS. It's only a couple of weeks until I change it. But all I can do is the homepage. Everything else produces errors.

I think my problem is in the .htaccess file:

# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> #END WordPress 

Is there anything equivalent to this for IIS?

Thanks.

+6
iis .htaccess server-migration
source share
4 answers

I think you will find the answer here - How to set up pretty permanent links in Wordpress in IIS 7 I think you need to put one web.config file in the root folder, for example:

 <?xml version="1.0"?> <configuration> <system.webServer> <defaultDocument> <files> <remove value="index.php" /> <add value="index.php" /> </files> </defaultDocument> <rewrite> <rules> <rule name="Main Rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:0}" /> </rule> </rules> </rewrite> </system.webServer> </configuration> 
+10
source share

"Pretty" permalinks usually require mod_rewrite and IIS (shared on Windows Servers) does not support mod_rewrite.

Check the Wordpress Codex code, in particular Permalinks Without Mod Rewrite , as it contains information about permalinks in your environment (some information below, check the link for full information, as this is the official documentation):

If you are using IIS 7 and have administrator privileges on your server, you can use the Microsoft URL Rewrite Module instead. Although not fully compatible with mod_rewrite, it makes WordPress support fairly permalinks. After installation, open the web.config file in the WordPress folder and add the following system.webServer rule.

 <rewrite> <rules> <rule name="Main Rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite> 
+2
source share

"Pretty" permalinks usually require mod_rewrite and IIS (shared on Windows Servers) does not support mod_rewrite.

Whether you use IIS6 or 7, you can also use the rewrite mechanism in IIS - many of them support the mod_rewrite syntax.
IIRF is good, it works with both IIS6 and 7 (Vista, WS2003, 2008).

+1
source share

A new installation of WordPress has completed, followed by selective import of tables.

Of course, the problem was constant. But I found the easiest way to fix this, to use the same structure as the previous site (fortunately, it was not deleted yet, so I could find it in the admin panel) and then imported everything except the user tables.

If you import user tables, you will lose the administrator login from the new setting.

0
source share

All Articles