xml htaccess for web.config IIS(Windows Server)for Wordpress

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml htaccess for web.config IIS(Windows Server)for Wordpress相关的知识,希望对你有一定的参考价值。

REF: http://codex.wordpress.org/Using_Permalinks#Permalinks_without_mod_rewrite

REF: https://www.customfitonline.com/news/2013/6/20/solve-wordpress-on-windows-server-problems/

IIS 

THIS GOES IN THE WEBROOT OF THE WEBSITE, REPLACES THE HTACCESS FILE

Create filename: web.config
With the following contents
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <directoryBrowse enabled="false"/>
    <defaultDocument>
      <files>
        <clear/>
        <add value="index.php"/>
        <add value="Default.htm"/>
        <add value="Default.asp"/>
        <add value="index.htm"/>
        <add value="Default.aspx"/>
      </files>
    </defaultDocument>
    <rewrite>
      <rules>
        <rule name="wordpress" patternSyntax="Wildcard">
          <match url="*"/>
            <conditions>
              <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>
  </system.webServer>
</configuration>


== this is equivalent to htaccess and fixes permission errors when adding new plugins ==

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

以上是关于xml htaccess for web.config IIS(Windows Server)for Wordpress的主要内容,如果未能解决你的问题,请参考以下文章

htaccess - 将所有文件重写为 index.php,除了 sitemap.xml

htaccess:从以.xml / only结尾的URL中删除尾部斜杠

htaccess for laravel 在所需文件夹中

prerender htaccess for subirectory url

apache_conf .htaccess for SlimPHP API允许授权标头

AllowOverride for .htaccess 在本地机器上给出 403 Forbidden