Logo Pupungbp.com

Need a WordPress expert help?

How to set posts redirect to a new domain

Last Updated: June 28, 2017 | Reading Time: < 1 minute

I’m moving out a blog to a new domain, and redirect all posts specifically to a new domain.

http://olddomain.com/category/postname

should go to

http://newdomain.com/category/postname

Apache Server

On Apache that allows .htaccess, you can add this line on top of the file:

RewriteEngine on
RewriteRule ^(.*)$ http://www.newsite.COM/$1 [R=301,L]

Nginx Server

On Nginx, add this line on server block configuration file:

server {
return 301 http://newdomain.com$request_uri;
}

Reload or restart Nginx for the change to take effect.

 

Looking for an affordable WordPress solution?

We offer budget-friendly WordPress website development services to meet your needs. Prices start at $10.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.