Mobile app version of vmapp.org
Login or Join
Ogunnowo487

: 301 redirect whole site to the homepage of another? I would like to redirect my whole site to the homepage of another site. I know I could do this in JavaScript but I prefer to have the

@Ogunnowo487

Posted in: #Redirects

I would like to redirect my whole site to the homepage of another site. I know I could do this in JavaScript but I prefer to have the 301 Redirect for SEO reasons. How could I do this while maintaining the 301 redirect?

At the moment I changed the .htaccess file with:

Redirect 301 / www.newdomain.com/

but when someone types olddomain.com/something/ instead of going into the homepage of the new site, they go to newdomain.com/something/.

How can I fix this while maintaining the 301 redirect for SEO reasons?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ogunnowo487

1 Comments

Sorted by latest first Latest Oldest Best

 

@Harper822

This will do the trick in .htaccess provided you have mod_rewrite module installed:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ www.example2.com/? [R=301,L]


Just replace example with your domain and example2.com with the new domain to redirect to.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme