url-rewrite - 请教这段rewrite如何修改成nginx能够读懂的代码
给我你的怀抱
给我你的怀抱 2017-05-16 17:28:16
0
1
886

这是一段.htaccess,我想修改成nginx重写规则,我本人对域名重写不了解,希望有朋友能够指点一下,谢谢

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*)  [L]
RewriteRule ^(.*\.php)$  [L]
RewriteRule . index.php [L]
给我你的怀抱
给我你的怀抱

全部回复(1)
刘奇

找到答案了

#ignored: “-” thing used or unknown variable in regex/rew
rewrite ^/([_0-9a-zA-Z-]+/)?wp-admin$ /wp-admin/ permanent;
if (-f $request_filename){
    set $rule_2 1;
}
if (-d $request_filename){
    set $rule_2 1;
}
if ($rule_2 = "1"){
#ignored: “-” thing used or unknown variable in regex/rew
}
rewrite ^/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) / last;
rewrite ^/([_0-9a-zA-Z-]+/)?(.*.php)$ / last;
rewrite /. /index.php last;
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板