简体   繁体   中英

Problems with redirect, permalinks wordpress

I have a wordpress site, the url was www.mysite.com/name-of-the-post

But the client change to www.mysite.com/blog/name-of-the-post

Now I have a problem with the users who click on old links, they can't access the content.

How can I solve this? I've reading about and something with regular expressions on htaccess, how can I add "/blog" when the users trying to access old links?

Thanks guys

Where I will put this code? My htaccess is this:

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

# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM