문제

CodeInter Powered 사이트와 함께 살려고합니다. URL에서 index.php를 제거하여 다음 대신 :

http://www.mysite.com/index.php/controller

나는 다음과 같은 것을 얻는다 :

http://www.mysite.com/controller

지금까지 매우 간단합니다. 과거에는 Codeigniter 문서에서 제공 한 Mod-Lerewrite 규칙을 사용했습니다.

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

이것은 매력처럼 작동합니다. 그러나이 사이트의 경우 Apache 대신 Zeus 웹 서버를 사용해야하며 전혀 익숙하지 않습니다. Zeus는 다음과 같은 자체 재 작성 규칙이 있습니다.

RewriteCond %{REQUEST_FILENAME} !-f  
RewriteRule ^[^/]*\.html$ index.php

이것이 될 것입니다 :

match URL into $ with ^/[^/]*\.html$
if matched then set URL = /index.php

누구든지 제우스의 첫 번째 규칙을 다시 작성하도록 도와 줄 수 있습니까? 매우 감사하게받은 도움이 있습니다!

도움이 되었습니까?

해결책

파악했습니다 - 다음은 나에게 잘 작동합니다.

map path into SCRATCH:DOCROOT from /

set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}

look for file at %{SCRATCH:DOCROOT}%{SCRATCH:REQUEST_URI}
if not exists then look for dir at %{SCRATCH:REQUEST_URI}%{SCRATCH:REQUEST_URI}
if not exists then set URL = /index.php%{SCRATCH:REQUEST_URI}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top