.htaccess 启用干净的URL(Drupal 7)
我刚刚安装并开始使用Drupal7,然后按照说明打开干净的URL。我单击了“运行干净的URL测试”按钮,但它没有返回任何结果。它加载一些内容,然后刷新页面。没有如说明中所述启用干净url的选项。有人能帮忙吗?在项目根目录中打开.htaccess文件。 取消注释.htaccess 启用干净的URL(Drupal 7),.htaccess,drupal-7,seo,clean-urls,.htaccess,Drupal 7,Seo,Clean Urls,我刚刚安装并开始使用Drupal7,然后按照说明打开干净的URL。我单击了“运行干净的URL测试”按钮,但它没有返回任何结果。它加载一些内容,然后刷新页面。没有如说明中所述启用干净url的选项。有人能帮忙吗?在项目根目录中打开.htaccess文件。 取消注释RewriteBase/drupal并将其更改为项目名称,如RewriteBase/myprojectname。 注释RewriteBase/ 转到/admin/config/search/clean URL 将有一个选项来启用干净的URL
RewriteBase/drupal
并将其更改为项目名称,如RewriteBase/myprojectname
。
注释RewriteBase/
转到/admin/config/search/clean URL
将有一个选项来启用干净的URL
For Ubuntu Server 13.04
sudo a2enmod rewrite
sudo vi /etc/apache2/sites-enabled/default
If there is no such file, try this one: /etc/apache2/sites-enabled/000-default
Change (line 7 and line 11), "AllowOverride None" to "AllowOverride All".
Save and exit.
Restart Apache
sudo /etc/init.d/apache2 restart
如果您使用的是apache 2.4版,请在/etc/apache2/sites available/000-default.conf文件中添加以下代码
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
选项索引跟随符号链接多视图
允许超越所有
命令允许,拒绝
通融
首先,如果使用apache,请转到
/etc/apache2/sites available
然后用您喜爱的编辑器打开000 default.conf
,并将此命令添加到该conf:
<Directory /var/www/html>
AllowOverride All
</Directory>
允许超越所有
最后,在终端中键入sudo service apache2 restart