301 redirect domain

Keywords: WordPress - Google Cloud Platform - How to - Secure Connections (SSL/HTTPS)


I would like to do a 301 redirect from 1 domain to another. After a search from the forum posts, I think I need to add the following snippet?

#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ https://www.newsite.com/$1 [R=301,L]

I’ve added the above in /opt/bitnami/wordpress/.htaccess and bitnami.conf, it doesn’t work.

What are the steps to take and files to edit to 301 redirect old domain to a new one?

Much Thanks

To provide more info:

What I am trying to do is to 301 redirect all urls of old.com to the home page of new.com. For e.g.

old.com — to —> new.com
old.com/abc ---- to ----> new.com
old.com/abc/123 ---- to ----> new.com
old.com/wp-admin ---- to ----> new.com

Thank you

Hi @4WU,

htaccess files are disabled by default


You can follow this guide


Happy to help!

Was my answer helpful? Click on :heart:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.