有人可以帮助我将此web.config
文件转换为.htaccess
<rules>
<rule name="Rewrite to index" stopProcessing="true">
<match url="^(.+)$" ignoreCase="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?permalink={R:1}" />
</rule>
</rules>
答案 0 :(得分:0)
这看起来像一个标准的前控制器模式。即。内部重写所有未映射到现有文件或目录的index.php?permalink=<URL>
请求。
所以,在.htaccess
中这样的事情:
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?permalink=$1 [L]