2013-03-07 179 views
0

我在这里有一个令人沮丧的问题。不确定是什么导致了它。我的Drupal站点运行在带有IIS 7的Windows服务器上。当我进入http://example.com/admin页面时,出现403错误。但是,如果我登录http://example.com/?q=user然后去/管理它工作正常。我猜测在IIS中的设置存在问题,或者存在某种错误的权限。在我的网站的根目录中没有管理员目录,所以它不是一个流氓文件夹搞砸的事情。有任何想法吗??去Drupal站点/管理页面时出现403错误

这里是我的web.config ..

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
    <!-- Don't show directory listings for URLs which map to a directory. --> 
    <directoryBrowse enabled="false" /> 
    <rewrite> 
     <rules> 
     <rule name="Protect files and directories from prying eyes" stopProcessing="true"> 
      <match url="\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$" /> 
      <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." /> 
     </rule> 
     <rule name="Force simple error message for requests for non-existent favicon.ico" stopProcessing="true"> 
      <match url="favicon\.ico" /> 
      <action type="CustomResponse" statusCode="404" subStatusCode="1" statusReason="File Not Found" statusDescription="The requested file favicon.ico was not found" /> 
     </rule> 
     <!-- Rewrite URLs of the form 'x' to the form 'index.php?q=x'. --> 
     <rule name="Short URLs" stopProcessing="true"> 
      <match url="^(.*)$" ignoreCase="false" /> 
      <conditions> 
      <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> 
      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> 
      <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" /> 
      <!--<add input="{REQUEST_URI}" pattern="^/(gallery2|message-boards)" negate="true" />--> 
      </conditions> 
      <action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" /> 
     </rule> 
     </rules> 
    </rewrite> 

    <!-- <httpErrors> 
     <remove statusCode="404" subStatusCode="-1" /> 
     <error statusCode="404" prefixLanguageFilePath="" path="/index.php" responseMode="ExecuteURL" /> 
    </httpErrors> 
    --> 



    <defaultDocument> 
     <!-- Set the default document --> 
     <files> 
     <remove value="index.php" /> 
     <add value="index.php" /> 
     </files> 
    </defaultDocument> 
     <staticContent> 
      <mimeMap fileExtension=".woff" mimeType="application/x-woff" /> 
     </staticContent> 
    </system.webServer> 
</configuration> 
+0

请发布您的“web.config”文件。 – haim770 2013-03-07 15:13:17

+0

现在就添加它 – Dustin 2013-03-07 15:21:10

回答

0

/Q =用户意味着你没有启用干净的URL。

尝试通过导航到/?q = admin登录。然后确保你的网站的根目录中有.htaccess(它是隐藏的,所以你必须在你使用的任何平台上启用“查看隐藏文件”)。

一旦你确定它在那里 - 如果不是重新下载Drupal隐藏文件可见的获取文件 - 清除缓存,去“配置” - >“搜索和元数据” - >“干净的URL” - >启用