先检查http.conf里是否有以下代码,任意都可

LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c

查看apache是否安装了模块

apachectl -M

 

如果有,则可以按照下面的操作。

在网站下加入以下rewrite规则。

<Directory /var/www/example.com>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>

如果不想这么模范,也可以直接修改网站目录下的相关信息

AllowOverride All
AccessFileName .htaccess

 

如果依然不行,就参考下面的官方地址吧,全E文。

http://drupal.org/node/15365

posted on 2011-12-22 18:02  fooboo  阅读(501)  评论(0编辑  收藏  举报