如何从带有参数的 url 中删除 .html?
例如:http : //www.domain.com/somepage.html?argument= whole& bunch=a-lot
到:
http://www.domain.com/somepage?argument=whole&bunch=a-lot
我试过了
location / {
index index.html index.php;
rewrite ^\.html(.*)$ $1 last;
try_files $uri $uri/ @handler;
expires 30d; ## Assume all files are cachable
}
Run Code Online (Sandbox Code Playgroud)
和一堆其他建议,但似乎无法让它发挥作用....
Tnx