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.
我的网址目前看起来像这样
http://www.mydomain.com/index.php?videoID=6nR9nsKTx4g
但我想通过
http://www.mydomain.com/6nR9nsKTx4g
我这样试过
RewriteEngine On RewriteRule ^([^/]*)$ index.php?videoID=$1 [L]
但是没有传输videoID。那个代码有什么问题?谢谢
您缺少 QSA,这会附加查询字符串
RewriteEngine On RewriteRule ^([^/]*)$ index.php?videoID=$1 [L,QSA]
我看不出这不起作用的任何原因,查看您使用的代码,它看起来很正确。
尝试添加 phpinfo(); 死(); 到代码顶部并检查 _GET 变量以确保已设置变量。