Nginx配置WordPress的rewrite规则
Apache的默认规则为:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILE[......]
Apache的默认规则为:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILE[......]
在.htaccess文件中写入下面三行:
RewriteBase / RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.coderdoc.cn/$1 [R=301,L]
第三行域名改成自己的即可。[……]
在网站根目录的.htaccess文件中写入:
<IfModule mod_rewrite.c> RewriteEngine On #RewriteCond %{SERVER_PORT} !^443$ #RewriteRule ^(.*)?$ https:/[......]
代码如下:
<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^go/(.*)$ index.php?go=$1 [L] RewriteRule ^(book)$ tj/book [R=301,NC,L] RewriteRule[......]