0

내 사이트의 URL 구조를 https://www.compareking.no/post-detail.php?post-id=1에서 https://www.compareking.no/postdetail/post-id/1으로 변경하고 싶습니다. 하지만 SSL 사이트에 대해 작동하지 않습니다다시 쓰기 URL이 htaccess에서 작동하지 않습니다.

내 코드는 다음과 같습니다

URL의 시작 없음 /
Options +FollowSymLinks -MultiViews 
    # Turn mod_rewrite on 
    RewriteEngine On 
    RewriteBase/
    RewriteRule ^/postdetail/([0-9]+)$ /post-detail.php?post-id=$1 
+0

귀하의 재 작성 규칙이 URL이 'https로 작동하는 것 같다/([0-9] +) $ /post-detail.php? post-id = $ 1' – ASR

+0

@ASR 나는 길을 시도했다. 그러나 일하지 마라. 다른 해결책이 있다면 알려주십시오. –

답변

0

.htaccess에서 당신은 거의있다. URL의 시작 부분에있는 /은 절대로 일치하지 않습니다 (비록 httpd.comf). 시도 : // www.compareking.no/postdetail/1` (후 ID를 제거) 또는 노력이`RewriteRule의 ^/postdetail/후 ID :

Options +FollowSymLinks -MultiViews 
# Turn mod_rewrite on 
RewriteEngine On 
RewriteBase/
RewriteRule postdetail/([0-9]+)/?$ post-detail.php?post-id=$1 [B,QSA,L] 
+0

나는 그것을 시도했지만 작동하지 않습니다. 그리고 .htaccess 파일이 작동 중입니다. URL에서 .php를 제거하면 작동합니다. –

관련 문제