Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以上帝的名义
你好,
我如何转换这个网址
domain.tld/blog.php?name=username&page=2
对这个
用户名.domain.tld/page/2
与.htaccess?
将以下指令添加到网站根目录 (domain.tld) 中的 .htaccess 文件(如果不存在则创建)
RewriteEngine on RewriteBase / RewriteCond %{QUERY_STRING} name=([^&]+) RewriteCond %{QUERY_STRING} page=([^&]+) RewriteRule ^blog.php$ http://%1.domain.tld/page/%2? [R=301,L,NC]