apache-nginx-url-rewrite-convert

Apache(.htaccess):

RewriteEngine On
RewriteBase /
RewriteRule ^()$ index.php [NC,L]
Rewritecond %{REQUEST_URI} !(^/?.*..*$) [NC]
RewriteRule (.*)$ $1.php [NC]

nginx:

location / {
root /htdocs/;
index index.php index.html index.htm;
rewrite ^/()$ /index.php last;
rewrite /(.*)$ /$1.php;
}

Published by

@XiaoKyun

双鱼男,过分热心的好人。