WAMP +目录别名+ Drupal干净的URL

时间:2011-04-16 14:03:18

标签: drupal drupal-6 wamp

我在我的电脑上安装了WAMP,我想运行Drupal 6.

当我安装Drupal时,我可以选择激活干净的URL 首先,我将Drupal安装在www文件夹中,然后我可以选择启用干净的URL,但出于备份原因,我将其移到www文件夹之外,并创建了一个指向文件夹的别名。 当我再次安装Drupal时,我无法再选择启用干净的URL;选项显示为灰色。

我想知道为什么会这样;似乎在www文件夹之外没有一些Apache模块或PHP扩展。

为了确定,我还尝试了一个XAMPP安装并使用WAMP服务器中的一些代码行创建了一个别名,但由于某种原因,这样做有效。 WAMP中的Apache版本与XAMPP安装不同,但我认为这并不重要。

我认为这是WAMP中的配置错误,但我找不到。

1 个答案:

答案 0 :(得分:5)

Clean URL在您复制Drupal的目录中不起作用,因为对于该目录,指令AllowOverride未设置为All
Drupal要求启用.htaccess文件中的每个指令,以便启用干净的URL;指令AllowOverride设置为All时,允许使用.htaccess可以包含的所有指令。

在一种情况下,您可以选择启用干净URL的选项,而在另一种情况下是不可选择的原因是Drupal在安装过程中验证服务器是否设置为使用干净的URL,并更改如果服务器不支持此类功能,则表单字段为只读。

要注意可能需要编辑Drupal提供的.htaccess文件,以便在.htaccess文件中找到干净的URL,如以下注释中所述。

# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
相关问题