2014-12-03 2 views
1

도와 줘요 난 그냥이 다시 쓰기 규칙 작업 점점 문제가 발생 : 그래서 등등 /information/test.html/information.html and index.php?L0=information&L1=testindex.php?L0=information에서 변경 및재 작성 규칙이 작동하지 않습니다 -

RewriteRule ^([0-9a-zA-Z-].html$+) index.php?L0=$1 [NC,L] 
RewriteRule ^([0-9a-zA-Z-]+)/([0-9a-zA-Z-].html$+) index.php?L0=$1&L1=$2 [NC,L] 
RewriteRule ^([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-].html$+) index.php?L0=$1&L1=$2&L2=$3 [NC,L] 

...

수 누구나 왜 작동하지 않는지 명백한 것을 볼 수 있습니까?

+0

나는 .html이() 밖에 있어야한다고 가정합니다. 그렇지 않으면 url ([0-9a-zA-Z] +)에서 반복 할 것이며 ([0-9a-zA- Z] .html +) – andrew

답변

0

이 중복 된 +$ 이후이며 캡처 된 그룹은 .html을 포함해서는 안됩니다. 이것을 시도하십시오 :

RewriteRule ^([0-9a-z-]+)\.html$ index.php?L0=$1 [QSA,L,NC] 
RewriteRule ^([0-9a-z-]+)/([0-9a-z-]+)\.html$ index.php?L0=$1&L1=$2 [QSA,L,NC] 
RewriteRule ^([0-9a-z-]+)/([0-9a-z-]+)/([0-9a-z-]+)\.html$ index.php?L0=$1&L1=$2&L2=$3 [QSA,L,NC] 
+0

'[NC]'로 각 테스트와 INDEX 또는 HTML에 대해 [0-9a-z-]를 사용할 수 있습니다. – Croises

+0

NC와 QSA를 사용하여이 작업을 수행 할 수 없습니다 – ajl80

+0

index.php ? L0 = 정보와 htaccess는 index.php와 같은 루트 디렉토리에 있습니다 – ajl80

관련 문제