2012-03-04 7 views
1

나는 간단한 htaccess로 파일이것은 mod_rewrite 버그입니까? 아니면 방금 누락 되었습니까?

RewriteEngine on 

RewriteRule ^[^-]*-(.*)$ http://example.com/$1 [R] 
RewriteRule ^[(template)(internal)(stuff)(files)] - [L] 

RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?category=$1&page=$2 [L] 
RewriteRule ^([^/\.]+)/?$ index.php?page=$1 [L] 
RewriteRule ^/$ index.php?page=news [L] 

이 내가 http://example.com/foo/bar 모든 것을 요청할 때 괜찮 - 아파치가 http://example.com/index.php?category=foo&page=bar로 리디렉션하지만 난 (카테고리 이름이 또는 z로 시작하는 경우)는 아무튼 http://example.com/aoo/bar 또는 http://example.com/zoo/bar을 요청하는 경우 하나의 오류로 리디렉션되지 않습니까?

.htaccess tester http://htaccess.madewithlove.be도 마찬가지입니다.

누구나 알아낼 수 있습니까?

편집 : aoo/bar - 404; 부/바 - index.php; coo/bar - index.php; doo/bar - index.php; eoo/bar - 404; foo/bar - 404; goo/bar - index.php; hoo/bar - index.php; ioo/bar - 404; joo/bar - index.php; 구/바 - 404; loo/bar - 404; 음 ~/모음 - 404; noo/bar - 404; ooo/bar - index.php; 푸/바 - 404; qoo/bar-index.php; roo/bar, soo/bar도/bar - 404; uoo/bar, voo/bar, woo/bar, xoo/bar, yoo/bar-index.php; 동물원/술집 - 404

+0

404 오류가 발생합니까? (다만 확실하십시오) – SergeS

+0

예, aoo/bar는 404를 보내지 만 foo/bar index.php는 올바르게 표시됩니다. – milleniumbug

+0

[^/\.]을 [a-zA-Z]로 바꿀 수 있습니다. 아마도 도움이 될 것입니다. 온라인 테스터는이 오류를 재현하지 않습니다. – SergeS

답변

1

두 번째 규칙은 FUBAR입니다. 당신이 원하는 것을 찾아내어 다시 시도하십시오.

+0

두 번째 규칙은 templates 또는 internal 또는 stuff 또는 files라는 단어가 포함 된 표현식을 일치시키고 이미 서버에있는 파일로 리디렉션하는 것입니다. 표현식이 일치하지 않는 경우 - 다른 모든 것을 index.php로 리다이렉트하십시오 – milleniumbug

+0

실제적으로 * 않습니다 *는하지 않습니다 ... –

+0

^(template | internal | stuff | files) – milleniumbug

관련 문제