mod_rewrite模块的使用

1.
httpd.conf中确保
LoadModule rewrite_module modules/mod_rewrite.so

2.

<Directory "C:/php/mywork">

   

#AllowOverride None改成


AllowOverride All

</Directory>

3.实验一
建立一个.htaccess文件,目的是将alice.html=>bob.html

RewriteEngine on
RewriteRule ^alice.html$ bob.html
 
4.实验二
code igniter去掉index.php的例子

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ test/index.php/$1 [L]

posted @ 2009-05-13 15:51  Fan Zhang  阅读(210)  评论(0)    收藏  举报