4、把下面的内容保存为.htaccess文件放到入口文件的同级目录下
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>
重启Apache之后,原来的 http://serverName/index.php/Blog/read/id/1 就可以通过访问 http://serverName/Blog/read/id/1 简化了URL地址。
更多PHP相关知识,请访问PHP中文网!
以上就是ThinkPHP利用.htaccess文件的Rewrite规则隐藏URL中的index.php的详细内容,更多请关注Gxlcms其它相关文章!