apache
http://xxxx/product/参数.html重写到http://xxxx/product.php 可以用 $_GET["参数"]
RewriteEngine On
# Redirecting http://xxx/product/参数.html to product.php
RewriteRule ^product/([^/]+)\.html$ /product.php?parameter=$1 [L]
# Redirecting http://xxx/news/参数.html to news.php
RewriteRule ^news/([^/]+)\.html$ /news.php?parameter=$1 [L]
nginx
location /product/ {
# 匹配以 /product/ 开头的 URL
rewrite ^/product/(.*)\.html$ /product.php?parameter=$1 last;
}
location /news/ {
# 匹配以 /news/ 开头的 URL
rewrite ^/news/(.*)\.html$ /news.php?parameter=$1 last;
}