RewriteEngine on
RewriteCond $1 !^(index/.php|images|robots/.txt) //排除文件或文件夹跳转
RewriteRule ^(.*)$ /index.php/$1 [L] //设置跳转
保存成 .htaccess
fopen('.htaccess','+w'); //生成文件.htaccess
本文介绍如何使用.htaccess文件配置URL重写规则,实现特定文件或目录的跳转排除,并给出具体的.htaccess文件生成示例。
RewriteEngine on
RewriteCond $1 !^(index/.php|images|robots/.txt) //排除文件或文件夹跳转
RewriteRule ^(.*)$ /index.php/$1 [L] //设置跳转
保存成 .htaccess
fopen('.htaccess','+w'); //生成文件.htaccess
1万+
56万+

被折叠的 条评论
为什么被折叠?