2016-07-31 3 views
-1

사례 1과 사례 2가 함께 작동하지 않습니다. .htaccess 파일에서 사례 2를 삭제하면 사례 1이 작동합니다. 케이스 1 전에 케이스 2를 작성하면 케이스 2가 작동하지 않고 케이스 1이 작동합니다.다시 쓰기 규칙 충돌 .htaccess

사례 1 :

RewriteRule /(.*)\.html storycategory.php?story=$1 

예 :

http://localhost/romoko1/story/bedroom.html 

케이스 2 :

RewriteRule /(.*)\.html tag.php?tag=$1 

예 :

http://localhost/romoko1/tag/home-interior.html 
+0

'story /(.*) .html storycategory.php? story = $ 1'과'tag /(.*) .html tag.php? tag = $ 1'을 사용해보세요! –

+0

잘 작동하지 않습니다. –

+0

오키! 내 새로운 대답을 확인해주세요! –

답변

0

당신의 .htaccess에서 이것을 시도하십시오 :

<IfModule mod_rewrite.c> 

RewriteEngine On 

RewriteBase/

RewriteRule story/(.*).html storycategory.php?story=$1 
RewriteRule tag/(.*).html tag.php?tag=$1 

</IfModule> 

rewrite_module을 가능하게하는 것을 잊지 마십시오.

이 정보가 도움이되기를 바랍니다.

+0

# 아니 아니 하위 디렉토리 RewriteBase/romoko1/ –

+0

나는 로컬 호스트에서 일하고 있어요 나는 –

+0

http://www.romoko.com/storycategory.php?slug=bedroom –

관련 문제