2013-03-07 49 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」 - >啓用