thinkphp5中.htaccess 的定义,通过这个模式,也适用于其他.htaccess定义

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On

#index.php/admin/users/index.html
RewriteRule ^(.*)list\.html$ $1/admin/users/index\.html

#index.php/admin/users/update/id/1.html
RewriteRule ^(.*)show_([0-9]+)\.html$ $1/admin/users/update/id/$2

#index.php/admin/users/index.html?page=2
RewriteRule ^(.*)p_([0-9]+)\.html$ $1/admin/users/index/page/$2
# http://127.0.0.1/tc/004_oop/tp5/public/p_2.html

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>


关注公众号,了解更多it技术(it问答网

发表评论

电子邮件地址不会被公开。