在例如:笨公共目录中的URL
- index.php
- /system
- /application
- /controller
- test.php (class:test ; function index() ; echo "hi")
- /public
- style.css
我将浏览器指向http://mysite.com/它会显示 “HI”
如果我想的style.css,我必须指向http://mysite.com/public/style.css
但我想指出http://mysite.com/style.css可以显示的style.css太
我试图移动的index.php到系统中的公开之前加前缀../ d应用
我也设置在根目录中的htaccess的,那么我就可以成功地指向http://mysite.com/style.css为style.css的
但是还有另外一个问题,我不能指向我的测试控制器了,它显示错误404
我怎样才能保持这两个网址是什么?
UPDATE:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^public/.+$ - [L]
RewriteCond %{DOCUMENT_ROOT}/public/$0 -f
RewriteRule ^.+$ /public/$0 [L]
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
当我访问http://mysite.com/style.css可以显示的style.css
但不是控制器的测试工作,我访问http://mysite.com/test/test/index显示404:
在根目录的htaccess没有“喜”
这是有道理的有它在/公/并通过/public/style.css调用它;那有什么问题?另外,请发布您的.htaccess。 – stormdrain 2013-04-05 19:03:20
这似乎是htaccess的在您重写规则有问题,发表您的htaccess更多的帮助 – bizzehdee 2013-04-05 19:04:36