2011-04-16 66 views
3

我已经在我的电脑上安装WAMP,我想运行的Drupal 6WAMP +目录别名+ Drupal的清洁网址

当我安装的Drupal,我得到激活清洁网址的选项。
首先,我把我的Drupal安装在www文件夹中,我可以选择启用干净的URL,但出于备份的原因,我将它移到www文件夹之外,并创建了一个别名,指向该文件夹。 当我再次安装Drupal时,我无法选择启用干净的URL;该选项变灰。

我想知道为什么会发生这种情况;似乎有一些Apache模块或PHP扩展在www文件夹外不可用。

可以肯定的是,我也尝试过XAMPP安装,并使用WAMP服务器中的一些代码行创建了一个别名,但由于某种原因,这些代码行都有效。 WAMP中的Apache版本与XAMPP安装不同,但我并不认为这是相关的。

我相信这是在WAMP中的配置错误,但我找不到什么。

回答

5

在您复制Drupal的目录中,干净的URL不起作用,因为该目录中的指令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/