如何在IIS Windows服务器上的Laravel托管中删除public / index.php

时间:2019-01-04 04:24:19

标签: php laravel iis

服务器人员在IIS服务器中创建了一个子域。但是当我像假设的那样访问网站时

subdomain.example.in   //Not working
subdomain.example.in/public   //working... but when i login it shows 404 not found
subdomain.example.in/public/index.php  //everything working. 

我在Google周围搜索,并且在.root文件夹中添加了.htaccess,如下所示:-

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule    ^$    public/    [L]
RewriteRule    (.*) public/$1    [L]
</IfModule>

 ---------------------web.config----- in public folder-----
 <configuration>
 <system.webServer>
  <rewrite>
  <rules>
    <rule name="Imported Rule 1" stopProcessing="true">
      <match url="^(.*)/$" ignoreCase="false" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
      </conditions>
      <action type="Redirect" redirectType="Permanent" url="/{R:1}" />
    </rule>
    <rule name="Imported Rule 2" stopProcessing="true">
      <match url="^" ignoreCase="false" />
      <conditions>
        <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" />
    </rule>
  </rules>
</rewrite>

但是上面的代码根本不起作用。甚至我都尝试过重命名server.php到index.php并将htacess文件从公共目录复制到根目录。仍然无法正常工作。谁能帮我解决这个问题。我正在使用IIS Windows服务器。我已经完成了许多网站并上传到Capnel中,我只是将htacess放在根目录上,然后它开始工作,但在IIS服务器上不工作。请帮助我

0 个答案:

没有答案