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]

转载于:https://www.cnblogs.com/fanzi2009/archive/2009/05/13/1455981.html

猜你喜欢

转载自blog.csdn.net/weixin_33835103/article/details/94192506
今日推荐