문제

I'm using ISAPI_Rewrite v2 to remove my index.php on IIS 6. This is how the rewrite should work:

http://dev.mysite.co.uk/mypage      => http://dev.mysite.co.uk/index.php/mypage
http://dev.mysite.co.uk/anotherpage => http://dev.mysite.co.uk/index.php/anotherpage

Using $_SERVER['REQUEST_URI'] I can see that what actually is happening is this:

http://dev.mysite.co.uk/mypage      => http://dev.mysite.co.uk/index.php/index.php/mypage
http://dev.mysite.co.uk/anotherpage => http://dev.mysite.co.uk/index.php/index.php/anotherpage

This causes a 404 error. The rewrite rules are contained in httpd.ini which is placed in my subdomain's root folder. Here is the rule i'm using:

[ISAPI_Rewrite]
RewriteRule ^(.*)$ /index.php/$1 [L]

Does anyone know what might be causing this? I've found this post which describes the same issue but it has no answers.

Thanks

도움이 되었습니까?

해결책

I guess it just loops, so please try to fix it like this:

[ISAPI_Rewrite]
RewriteRule /(?!index\.php/.*)(.*) /index.php/$1 [L]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top