[英]Apache to NGINX Rewrite Issue
I'm trying to convert this apache ReWriteRule
to NGINX but it doesn't seem to be working.我正在尝试将此 apache
ReWriteRule
转换为 NGINX 但它似乎不起作用。
Apache Rule: RewriteRule ^([A-Za-z0-9_-]+)\.php$ index.php?pagename=$1 [NC,QSA]
Apache 规则:
RewriteRule ^([A-Za-z0-9_-]+)\.php$ index.php?pagename=$1 [NC,QSA]
NGINX (not working): location / { rewrite ^/([A-Za-Z0-9_-]+)\.php? /index.php?pagename=$1; }
NGINX(不工作):
location / { rewrite ^/([A-Za-Z0-9_-]+)\.php? /index.php?pagename=$1; }
location / { rewrite ^/([A-Za-Z0-9_-]+)\.php? /index.php?pagename=$1; }
I do have the NGINX rule in a location block.我确实在位置块中有 NGINX 规则。
What am I missing here?我在这里想念什么? I looked at the other similar questions but didn't find enough suitable clues to solve the problem.
我查看了其他类似的问题,但没有找到足够的合适线索来解决问题。 Thanks for the help.
谢谢您的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.