How to rewrite the rules of Apache to nginx

Time:2021-3-7

RewriteEngine on
RewriteCond %{http_host} ^a.com [NC]
RewriteRule ^(.*)$ http://www.a.com$1 [R=301,L]

RewriteRule ^/redirect/(.*)$ /index/data/redirect.php?param=$1 [L]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/((?!.).)*(?<!/)$ $0/ [R=301,L]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !^/(public|admin)/{0,1}
RewriteRule ^/ /index.php [L]

This work adoptsCC agreementReprint must indicate the author and the link of this article

Recommended Today

Third party calls wechat payment interface

Step one: preparation 1. Wechat payment interface can only be called if the developer qualification has been authenticated on wechat open platform, so the first thing is to authenticate. It’s very simple, but wechat will charge 300 yuan for audit 2. Set payment directory Login wechat payment merchant platform( pay.weixin.qq . com) — > Product […]