简体   繁体   中英

Codeigniter 3 Mod_rewrite Plesk

so I uploaded my website in GoDaddy and I used a Windows Hosting (Plesk). My only problem is that since it isn't running Apache as far as I know, it won't read my .htaccess file, which has all of my mod_rewrite code to remove the index.php in the URL. So my question is how do I implement a mod_rewrite in Plesk?

You can rewrite .htaccess file to IIS's web.config and place it inside /httpdocs folder.

You can do it by guides like this or this online converter or if you have Windows Server you can convert .htaccess by this guide (or you can share your .htaccess and i'll try to convert it for you)

I've found this snippet maybe it can help you:

<?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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM