url重写实例(原创)

<VirtualHost *:80>
    ServerAdmin [email protected]
    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/

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注

1 + 8 =