0

Who could help me with the following:

I am moving my site to another domain AND I want to change my permalink structure. I wish to edit my .htaccess file of my OLD domain.

So:

http://www.olddomain.com/%YEAR/%MONTH/%DATE/example-post

SHOULD BE 301 REDIRECTED TO

http://www.newdomain.com/example-post

All my old URL's should be 301 redirected to the new URL's and new permalink structure.

What are the necessary steps I should take?

  • this blog post may can be your solution techtage.com/changing-permalink-structure-wordpress – rheeantz May 22 '17 at 15:03
  • thanks, but this generator only works with changing permalink structure and in my case I am changing domains too. – Rick May 22 '17 at 15:14
  • you can try to add additional php redirect on your single.php template. So after the oldmain get redirected with .htaccess rule you can redirect using php into newdomain – rheeantz May 22 '17 at 15:15
  • I only want to edit my .htaccess file on my old domain – Rick May 22 '17 at 15:17
  • please check my aswer @Rick – rheeantz May 22 '17 at 15:50
0

on your old domain add this following rule at the top of .htaccess

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$ http://newdomain.com/$3

plase let me know if its work or not.

  • you can mark my answer as accepted.. so people with the same problem will know the solution. – rheeantz May 22 '17 at 16:10
0

Assuming Mod_Rewrite is active, on .htaccess file you can use:

Redirect 301 http://www.olddomain.com/2015/05/22/example-post http://www.newdomain.com/example-post

  • Sorry, I was not clear. It concerns ALL links on the old site. Not just one URL. – Rick May 22 '17 at 15:01

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.