我有一些网址重写问题。 我有这样的网址:
http://url.com/?page=post&id=1&title=astanadaghy-qorghanys-ministrliigiiniinh-janyndaghy-jarylys-jayly-janha-aqparat
我想要这样的东西:
http://url.com/posts/1-astanadaghy-qorghanys-ministrliigiiniinh-janyndaghy-jarylys-jayly-janha-aqparat.html
怎么做?
答案 0 :(得分:0)
在.htaccess文件中
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?posts/([0-9]+)-([^\.*]+).html$ index.php?page=post&id=$1&title=$2 [L,QSA]