分页: 1 / 1

求助:apache: mod_rewrite

发表于 : 2007-03-04 11:51
sqlfm
还是求助拉。google了半天,还是不行。

$sudo a2enmod rewrite
$cd /etc/apache2/mods-enabled/
$sudo cp php5.conf rewrite.conf

rewrite.conf内容:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^a.html$ a.php [L]
RewriteRule ^/item/(A-Za-z0-9-]+)/([0-9]+)/?$ item.php?name=$1&page=$2 [L]
</IfModule>

$sudo ln -s /etc/apache2/mods-available/rewrite.conf rewrite.conf
$sudo gedit ../sites-available/default

Find the following text:

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

and change it to:

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all

$sudo /etc/init.d/apache2 restart

还是不工作 :(

http://localhost/a.html --- no such page
http://localhost/item/ubuntu/23 --- display item.php but no contents.

高手--帮帮忙拉--汗津津!

又:apache
目录下,如果没有index.php或,index.html 禁止访问,如何设置?拜托指导。

发表于 : 2007-03-04 14:45
huangjiahua
确定你有 apache2 rewrite 模块 ?

发表于 : 2007-03-04 22:39
SuperWar3Fan
是不是模块没有装载?