요즘 CodeIgniter를 사용하려고합니다. 기본적으로.htaccess는 상대 링크 문제로 index.php를 숨 깁니다.
그것은 컨트롤러
내부의 기능이
http://www.example.com/index.php/home
home
같은 URI에서의 index.php이다 가지고하지만 난 index.php
그래서 나는 htaccess로 파일을 생성하지 않으 :
Allow from all
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|img|robots\.txt|script|css)
RewriteRule ^(.*)$ index.php/$1 [L]
기본적으로 conds가 일치 할 때를 제외하고 "index.php"가 자동으로 추가됩니다. 이 같은 URI를 들어
:
그러나 여기에 일이 http://www.example.com/home
모든 것이 잘 작동합니다.
다음과 같은 URI의 경우 : http://www.example.com/home/
내 웹 페이지의 상대 링크는 자연스러워집니다.
예 : css/common.css
은 index.php/home/css/common.css
으로 리디렉션되어 css 파일을 찾을 수 없습니다.
로그는 다음과 같습니다
strip per-dir prefix: [dir to my site]/home/css/common.css -> home/css/common.css
applying pattern '^(.*)$' to uri 'home/css/common.css'
rewrite 'home/css/common.css' -> 'index.php/home/css/common.css'
add per-dir prefix: index.php/home/css/common.css -> [dir to my site]/index.php/home/css/common.css
trying to replace prefix [dir to my site]/ with/
internal redirect with /index.php/home/css/common.css [INTERNAL REDIRECT]
add path info postfix: [dir to my site]/index.php -> [dir to my site]/index.php/home/css/common.css
strip per-dir prefix: [dir to my site]/index.php/home/css/common.css -> index.php/home/css/common.css
applying pattern '^(.*)$' to uri 'index.php/home/css/common.css'
pass through [dir to my site]/index.php
나는이 문제를 해결할 수있는 방법?
로그를 추가하는 경우 +1! – Ansari