[英]I need url rewriting conversion from htaccess to NGINX
我尝试转换此.htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
到NGINX
location / {
try_files $uri $uri/ /index.php?_route=$uri;
}
但不起作用
如果工作,您会在http://test.bktvnews.com/data/menu/footer http://test.bktvnews.com/data/上看到json文件
您可以使用此在线工具进行转换。 http://winginx.com/cn/htaccess
这是您对Nginx的.htaccess
# nginx configuration
location / {
if (!-e $request_filename){
rewrite ^/(.)\?$ /index.php?route=$1 break;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.