我有一个URL是/forums/user.php/?user_id=6/,但我希望它只是/forums/user.php/6/和工作。我怎么能这么做呢?我试图做添加到.htaccess编辑网址,但它不太工作,它只是空白
RewriteEngine On RewriteRule ^user\.php/([^/]+)/?$ user.php?user_id=$1 [L]
x4shl7ld1#
将此行添加到.htaccess
RewriteEngine On RewriteRule ^forums/user\.php/([^/]+)/?$ /forums/user.php/?user_id=$1 [L,NC,QSA]
1条答案
按热度按时间x4shl7ld1#
将此行添加到.htaccess