永久链接更改后,wordpress旧链接不起作用

时间:2018-12-01 04:07:06

标签: php regex wordpress .htaccess

我以前的永久链接设置是

/index.php/%year%/%monthnum%/%day%/%postname%/

例如https://wittyanswer.com/index.php/2018/11/26/pubg/

我想这样改变:

Post name   https://wittyanswer.com/sample-post/

但是当我更改旧链接不起作用时,请帮助

.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

0 个答案:

没有答案