利用.htaccess去除codeigiter的index.php

作者:袖梨 2022-06-25

个人用的方法,感觉还不错:

代码如下 复制代码


Options +FollowSymLinks
RewriteEngine on
RewriteBase /poster
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

如果在根目录,那么把/poster改成/就行了,如果在http://xxx*.x*xx/*aaa 则把/poster改成/aaa

相关文章

精彩推荐