我的htaccess中有以下代码,我正在尝试让CodeIgniter忽略newdesign文件夹。
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|newdesign.*|cache.*)
RewriteRule ^(.*)$ index.php/$1 [L]使用这个我可以转到domain.com/newdesign,但不能转到domain.com/newdesign/anything_else,它给出了一个404
有谁能解释一下这件事吗?
我对htaccess不太在行!
如您所知,newdesign文件夹是域配置项设置的映像
发布于 2012-02-14 21:27:20
试试这个:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !^/(index\.php|images|newdesign[^/]*|cache[^/]*)$
RewriteRule ^(.*)$ index.php/$1 [L]发布于 2012-02-14 20:33:18
RewriteCond $1 !^(index\.php|images|newdesign|cache.*)这个怎么样,那个管用吗?我不认为你需要通配符来表示新的设计,
参考:http://codeigniter.com/user_guide/general/urls.html
发布于 2012-02-14 20:34:05
尝试卸下第三个RewriteCond。
这就是我的.htaccess中的东西,一切运行正常。我可以毫无问题地访问文件夹中的图像
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]https://stackoverflow.com/questions/9276837
复制相似问题