|
好贴,解决了我的问题!顶顶!
| |
|
CI 的 rewrite 这东西一般是这样写, 但是我也碰到不少,需要另外写法的 情况,
| |
|
<IfModule mod_rewrite.c>
RewriteEngine on RewriteCond 1ドル !^(index\.php|images|js|css|robots\.txt) RewriteRule ^(.*)$ /CodeIgniter/index.php/1ドル[L] </IfModule> php info 也显示mod_rewrite | |
|
但是URL 还是有index.php 这时怎么回事?
| |
|
查看 apache 手册,这问题和 CI 无关,CI 没有 rewrite 一样可以使用。
| |
|
贴下,我的
<IfModule mod_rewrite.c> <Files ~ "^.(htaccess|htpasswd)$"> deny from all </Files> Options -Indexes Options +FollowSymLinks #允许解析文件中的SSI指令 Options +Includes #定义404,500错误页面 ErrorDocument 404 /404.htm ErrorDocument 500 /404.htm #定义目录索引页面 DirectoryIndex index.php order deny,allow RewriteEngine on #设置根目录 RewriteBase /np/ #去掉链接地址中index.php字符串 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond 1ドル !^(index.php|images|robots\.txt) #RewriteCond 1ドル !^(index.php|images|robots\.txt)#排除的目录和文件类型 RewriteRule ^(.*)$ index.php/1ドル [L] </IfModule> | |
|
我都感觉不去也没什么不好吧!哈哈。。
| |