将web.confg转换为.htaccess

时间:2016-01-10 06:13:28

标签: apache .htaccess web-config

我正在尝试将IIS上的web.config转换为apache上的.htaccess。 虽然,我已经把一切都搞定了,但却陷入了困境。

<rule name="Imported Rule 2">
 <match url="^blog/([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
  <action type="Rewrite" url="index.php?url=blog&amp;id={R:1}" appendQueryString="false" />
</rule>

我正在尝试将上面的代码转换为.htaccess。 如果有人可以提供帮助,我们将不胜感激。

1 个答案:

答案 0 :(得分:0)

尝试将此配置添加到.htaccess

RewriteEngine on
RewriteRule ^blog/([a-zA-Z0-9_-]+)(|/)$ index.php?url=blog&id=$1