这是htaccess文件。
RewriteEngine On
RewriteRule ^blog_details/([0-9]) blog_details.php?p_id=$1[NC,L]
#Rewrite for blog_details.php?p_id=1&post_title=post_title
RewriteRule ^blog_details/([0-9]+)/([0-9a-zA-Z_-]+)/?$ blog_details.php?p_id=$1&post_title=$2[NC,L]
这是我要转换的链接
http://localhost/cedervilla/blog_details.php?p_id=12&post_title=post%20title%201
答案 0 :(得分:1)
适合我:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blog_details/([0-9]+)/([^/]+)$ blog_details.php?p_id=$1&post_title=$2 [L]