問:大哥 能幫我把htaccess轉換成web.config么, 不能也非常感謝,畢竟售后之外的事情,實在搞不定了,想在這個子目錄下安裝個站 web.config 不會寫,大哥 能幫我把htaccess轉換成web.config么
答:您好,
查看該主機www目錄里有一個.htaccess文件,但也已經存在web.config文件, 您是需要將現有.htaccess中的規則進行轉換嗎,非常感謝您長期對我司的支持!
問:<IfModule mod_rewrite.c>RewriteEngine onRewriteCond %{QUERY_STRING} ^/(.*)/$RewriteRule ^tags.php /index.php?m=tags&a=index&name=%1 [L]RewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]</IfModule>是這個
答:您好,
iis可以進行規則轉換,轉換后的規則如下,如無法使用或存在異常,則可能需要進一步調整,常感謝您長期對我司的支持!
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="1" stopProcessing="true">
<match url="^tags.php" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{QUERY_STRING}" pattern="^/(.*)/$" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="/index.php?m=tags&a=index&name={C:1}" appendQueryString="false" />
</rule>
<rule name="2" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
問:http://www.pls118.com/ceshi/tags.php?/%E6%96%B0%E9%97%BB/ 似乎不行呢
答:您好,
rule name=命名的問題,調整后訪問404,,規則放到子目錄可能會有 別,需要結合實際情況進一步調整,非常感謝您長期對我司的支持!