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.
我需要编写一个 htaccess 脚本来将请求重定向到我网站的各个页面。下面是几个例子——
http://mysite.com/index.php to http://mysite.com/index
和
http://mysite.com/somefile.php?id=1&value=something to http://mysite.com/somefile/1/something
我可以更改现有链接以进行重定向,请帮助。
就像是
RewriteEngine On RewriteBase / RewriteRule ^([a-z]+)\.php$ $1 [R=301] RewriteRule ^([a-z]+)\.php\?id=([0-9]+)&[a-z]+=(.*)$ $1/$2/$3 [R=301]