Nginx伪静态 转换为Apache 的

有段NGINX的伪静态 请高手转会到apache

rewrite ^/help/([0-9\-]+)/$ /aa.php?id=$1;
rewrite ^/2/([0-9\-]+)/$ /aa.php?id=$1;
rewrite ^/help/$ /cateaa.php?path=help;
rewrite ^/help/page-([0-9]+)\.html$ /cateaa.php?path=help&page=$1;
rewrite ^/page-([0-9]+)\.html$ /index.php?page=$1;
rewrite ^/tag/([^/]+)/$ /search.php?keywords=$1 last;
rewrite ^/tag/([^/]+)$ /search.php?keywords=$1 last;
rewrite ^/tag/([^/]+)/page-([0-9]+)\.html$ /search.php?keywords=$1&page=$2 last;
rewrite ^/search/([^/]+)/$ /search.php?keywords=$1 last;
rewrite ^/search/([^/]+)$ /search.php?keywords=$1 last;
rewrite ^/search/([^/]+)/page-([0-9]+)\.html$ /search.php?keywords=$1&page=$2 last;
rewrite ^/cate/([^/]+)/$ /search.php?keywords=$1 last;
rewrite ^/cate/([^/]+)$ /search.php?keywords=$1 last;
rewrite ^/cate/([^/]+)/page-([0-9]+)\.html$ /search.php?keywords=$1&page=$2 last;
最新回答
何必讨好

2024-04-13 10:14:44

把rewrite改成RewriteRule,每行后面的“;”符号去掉即可。
如:
RewriteRule ^/help/([0-9\-]+)/$ /aa.php?id=$1