我在这里遇到了令人沮丧的问题。不确定是什么导致它。我的Drupal站点在带有IIS 7的Windows服务器上运行。当我转到http://example.com/admin页面时,我收到403错误。但是,如果我使用http://example.com/?q=user登录,那么转到/ admin它可以正常工作。我猜测IIS中的设置有问题,或者某种权限是错误的。我的站点的根目录中没有管理目录,因此不是一个流氓文件夹的情况搞砸了。任何想法??
这是我的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 :(得分:0)
/?q =用户表示您没有启用干净的网址。
尝试导航到/?q = admin登录。然后确保你站点的根目录中有.htaccess(它是隐藏的,所以你必须在你正在使用的任何平台上启用“查看隐藏文件”)。
一旦你确定它在那里 - 如果没有重新下载Drupal,隐藏文件可见以获取文件 - 清除缓存,转到“配置” - &gt; “搜索和元数据” - &gt; “干净的网址” - &gt;使