I am looking to redirect all the posts and not pages and custom post types from old domain to new domain. So all posts for instance
http://www.example.com/post1
should go to http://example1.com/post1
http://www.example.com/post1
should go to http://example1.com/post1
The pages i.e. http://www.example.com/page1
should still be functional
I can find alot of answers on moving blog into sub directory along with moving all the links but not for moving just the posts and not the pages
Edit
There are over 1000 posts so I am looking for a dynamic way of doing this
Thank you for your help
The hack I finally end up using was
change
example.com
with your site domain nameI don´t think this is possible with this URL schema. .htaccess (or the Apache behind it) doesn´t know if
post1
is a post or page. How shall it then redirect on this base?If you would change the URL structure for pages alone (I don´t think this is possible by default, or am I wrong?) you could target their URL scheme and redirect.
To access the old pages (with the new URL) you could then use a “broken link checker” plugin.
Update: You could possibly use the hook described here to check wether the called post is a post or page and then use
wp_redirect
to call your new URL.