[英]Codeigniter 3 Mod_rewrite Plesk
所以我在GoDaddy上傳了我的網站,並使用了Windows主機(Plesk)。 我唯一的問題是,因為它並沒有運行Apache,據我所知,它不會讀取我的.htaccess文件,它有我的所有mod_rewrite代碼來刪除URL中的index.php。 所以我的問題是如何在Plesk中實現mod_rewrite?
您可以將.htaccess文件重寫為IIS的web.config並將其放在/ httpdocs文件夾中。
您可以通過此類指南或此在線轉換器進行操作,或者如果您有Windows Server,則可以通過本指南轉換.htaccess(或者您可以共享.htaccess,我會嘗試為您轉換它)
我發現這個片段也許可以幫到你:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Index">
<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/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.