2014-09-26 52 views
0

首先,我的英语不太好,那是因为我找不到我发现的东西。IIS + PHP - Url Rewrite Issue

好吧,这里是我的web.config规则

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
      <rule name="Imported Rule 1"> 
       <match url="^Girisyap$" ignoreCase="true" /> 
       <conditions logicalGrouping="MatchAll"> 
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
       </conditions> 
       <action type="Rewrite" url="giris.php" /> 
      </rule> 
       <rule name="Imported Rule 2" stopProcessing="true">> 
        <match url="^([0-9a-zA-Z-_/]+)$" /> 
        <action type="Rewrite" url="Sayfalar.php?Sayfa={R:1}" appendQueryString="true" /> 
       </rule> 
      </rules> 
     </rewrite> 
     <directoryBrowse enabled="false" /> 
    </system.webServer> 
</configuration> 

有了这个规则,当我试图访问的http://本地主机:84/Girisyap它显示giris.php为好。
如果我访问http:// localhost:84 /约告诉我Sayfalar.php?Sayfa =绕到也。
但是,当我访问http:// localhost:84/它给我403.14 - 禁止的错误。因为我没有使用index.php或default.php,我不想要它。
如何才能告诉'?Sayfalar.php Sayfa ='(Sayfa为空)访问到的http://本地主机:84/以及

回答

0

在Apache中,你会发现一个的index.php文件在htdocs,将默认网站设置为xampp文件夹(默认情况下)。也许你必须在IIS中找到相同的情况。尝试编辑默认网站到您的网站的目录,也许你可以设置你绑定到其他端口(如你所愿,它可以使用= 84)。祝你好运,它对我有用。 该代码添加到web.config文件

<system.webServer> 
    <defaultDocument> 
     <files> 
      <add value="Login.aspx" /> 
     </files> 
    </defaultDocument> 
    <directoryBrowse enabled="false" /> 
</system.webServer> 

注:为Login.aspx就是一个例子。将其更改为默认文档。

+0

我没有网站目录问题。我只是试图没有得到403错误。相反,我想显示'Sayfalar.php?Sayfa ='。有什么办法可以在web.config文件中做到这一点。 – traBolics 2014-09-26 02:12:20

+0

这是目录列表问题。它被某种东西否定,或者被确认。如果你正在寻找一个在web.config文件中的错误尝试添加代码 <添加值= “的Login.aspx”/> 2014-09-26 02:20:07