apache用.htaccess,轉換到IIS怎麼辦?就是改成web.config檔了。
把下面的內容存到web.config內,依據自己的需求改寫規則吧~
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”rule1″ stopProcessing=”true”>
<match url=”^(.*)-htm-(.*)” />
<action type=”Rewrite” url=”{R:1}.php?{R:2}” />
</rule>
<rule name=”rule2″ stopProcessing=”true”>
<match url=”^(.*)/show-([0-9]+)([-])?([0-9]+)?.html” />
<action type=”Rewrite” url=”{R:1}/show.php?itemid={R:2}&page={R:4}” />
</rule>
<rule name=”rule3″ stopProcessing=”true”>
<match url=”^(.*)/list-([0-9]+)([-])?([0-9]+)?.html” />
<action type=”Rewrite” url=”{R:1}/list.php?catid={R:2}&page={R:4}” />
</rule>
<rule name=”rule4″ stopProcessing=”true”>
<match url=”^(.*)/show/([0-9]+)/([0-9]+)?([/])?” />
<action type=”Rewrite” url=”{R:1}/show.php?itemid={R:2}&page={R:3}” />
</rule>
<rule name=”rule5″ stopProcessing=”true”>
<match url=”^(.*)/list/([0-9]+)/([0-9]+)?([/])?” />
<action type=”Rewrite” url=”{R:1}/list.php?catid={R:2}&page={R:3}” />
</rule>
<rule name=”rule6″ stopProcessing=”true”>
<match url=”^([a-z0-9]+).co/(.*)” />
<action type=”Rewrite” url=”company/index.php?homepage={R:1}&rewrite={R:2}” />
</rule>
<rule name=”rule7″ stopProcessing=”true”>
<match url=”^(htm)/(.*)” />
<action type=”Rewrite” url=”index.php?rewrite={R:2}” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
- [wordpress] 取的某分類頁面的term_id
- [教學] ckeditor 4.3 開啟上傳圖檔與瀏覽檔案功能
- [wordpress] 取的文章內容的第一張圖語法
- [CodeIgniter] 取得 mysql 欄位資訊的編碼(Collation)、權限(Privileges)、註解(Comment)的欄位
- [jQuery] live() 事件失效的修改方法
- [wordpress] 如何依據文章不同格式(post-formats),載入不同的樣板(get_template_part)?
- [wordpress] 如何在後台自定背景圖、背景顏色?
- [wordpress] 如何新增選單 menu ?
- [wordpress] bloginfo() 使用方法
- [Bootstrap] 讓 Dropdown 選單有滑鼠移上(Hover)展開效果