0

I was using this WordPress permalink string.

/%year%/%monthnum%/%postname%.html

but now I want to change it to, and redirect all old URLs to new URLs

/?p=65

Sample old URL is:

http://www.example.com/dead-hahaha_bruhhh.html

The new URL will be:

http://www.example.com/?p=123

My .htaccess file is currently using default WordPress vars. How can I 301 redirect all my old URLs to new URLs?

I tried to use this, but it's not working.

1
  • The "WordPress permalink string" which you say you were using does not match the "sample old URL" you have given? "I tried to use this" - You tried to use what? – MrWhite Aug 29 '17 at 19:06
1

Just choose Plain permalink settings on /wp-admin/options-permalink.php page. Wordoress would auto redirect all posts.

1
  • 2
    It should be pointed out that when changing permalink structure, the redirect that happens is basically a guess using a LIKE query on the slug. There are cases where you will end up getting redirected to the wrong post. – Milo Aug 29 '17 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.