我想将https://www.compareking.no/post-detail.php?post-id=1的网站网址结构更改为https://www.compareking.no/postdetail/post-id/1。但它不适用于SSl网站
我的代码是:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^/postdetail/([0-9]+)$ /post-detail.php?post-id=$1
答案 0 :(得分:0)
/
.htaccess
你快到了。您网址开头的/
将永远不会匹配(尽管它会在httpd.comf
中)。尝试:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule postdetail/([0-9]+)/?$ post-detail.php?post-id=$1 [B,QSA,L]