WordPress change permalinks and redirect new urls 301

I was using this WordPress permalink string.

/%postname%-%post_id%.html

but now I want to change it to, and redirect all old url’s to new url’s

Read More
/%postname%.html

Sample old url is;

http://www.example.com/dead-trigger-2-hile-mod-apk-indir-1890.html

The new url will be;

http://www.example.com/dead-trigger-2-hile-mod-apk-indir.html

My htaccess file currently using default wordpress vars. How can redirect all my urls to new urls 301.

I tryed to use this, but its not working

RedirectMatch 301 ^/(.*)-([0-9]{4})$ http://www.example.com/$1

Related posts

2 comments

  1. By following code you will be able to achieve 301 redirect via .Htaccess :

    Syntax :

    Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
    

    Example :

      # BEGIN 301 Redirects
        Redirect 301 /dead-trigger-2-hile-mod-apk-indir-1890.html http://www.example.com/dead-trigger-2-hile-mod-apk-indir.html
      # END 301 Redirects
    

Comments are closed.