瓦姆普 +目录别名 + Drupal 干净的 URL
我的电脑上安装了 WAMP,我想在其中运行 Drupal 6。
安装 Drupal 时,我可以选择激活 Clean URL。
首先,我将 Drupal 安装放在 www 文件夹中,我可以选择启用干净的 URL,但出于备份原因,我将其移到 www 文件夹之外,并创建了一个指向该文件夹的别名。 当我再次安装 Drupal 时,我无法再选择启用干净的 URL;该选项呈灰色。
我想知道为什么会发生这种情况;似乎某些 Apache 模块或 PHP 扩展在 www 文件夹之外不可用。
可以肯定的是,我还尝试了 XAMPP 安装并使用 WAMP 服务器中的一些代码行创建了一个别名,但由于某种原因,它有效。 WAMP 中的 Apache 版本与 XAMPP 安装不同,但我认为这并不相关。
我相信这是 WAMP 中的配置错误,但我无法找出原因。
I have WAMP installed on my pc where I would like to run Drupal 6.
When I'm installing Drupal, I get the option to activate Clean URLs.
First I put my Drupal install in the www folder and I could choose to enable the clean URLs, but for backup reasons I moved it outside the www folder and created an alias the would point to the folder.
When I installed Drupal again, I couldn't choose to enable clean URLs anymore; the option was grayed out.
I would like to know why this happens; it seems some Apache module or PHP extension isn't available outside the www folder.
Just to be sure, I also tried an XAMPP install and created an alias with the some code lines as in the WAMP server but that worked, for some reason. The Apache version in WAMP isn't the same as the XAMPP install but I don't really think that is relevant.
I believe it's an config error in WAMP but I can't find out what.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
干净 URL 在您复制的 Drupal 目录中不起作用,因为对于该目录,指令
AllowOverride
未设置为All
。Drupal 要求启用 .htaccess 文件中的每个指令,以便启用干净的 URL;指令 AllowOverride,当设置为
All,允许使用 .htaccess 可以包含的所有指令。
在一种情况下,您可以选择启用干净 URL 的选项,而在另一种情况下则不可选择,因为 Drupal 在安装过程中会验证服务器是否设置为使用干净 URL,并更改表单字段如果服务器不支持此类功能,则为只读。
请注意,可能需要编辑 Drupal 提供的 .htaccess 文件,以便启用干净的 URL,如以下注释中所述,可在 .htaccess 文件中找到。
Clean URLs doesn't work in the directory you copied Drupal because for that directory the directive
AllowOverride
is not set toAll
.Drupal requires that every directives found in .htaccess files are enabled, in order to enable clean URLs; the directive AllowOverride, when set to
All
, allows to use all the directives that a .htaccess can contain.The reason that in one case you can select the the option to enable the clean URLs, and in the other case is not selectable, is that Drupal, during its installation verifies the server is set to work with clean URLs, and change the form field to read-only if the server cannot support such feature.
To notice that the .htaccess file provided from Drupal can possibly need to be edited, in order to enable the clean URLs, as reported in the following comments, found inside the .htaccess file.