url重写实例(原创)

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot D:/www/mvc
    ServerName www.flea.com
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    # RewriteRule ^(.*)$ /index.php$1 [L]
    RewriteRule ^(/index/)+(.*)$ /index.php/$2 [L]
    RewriteLogLevel 7
    RewriteLog “D:/www/mvc/rewrite.log”
</VirtualHost>

# 这个表示将
# http://www.flea.com/index/hello/say/ 这种形式重写成
# http://www.flea.com/index.php/hello/say/



发表评论

您的电子邮箱地址不会被公开。

+ 10 = 13