Mobile app version of vmapp.org
Login or Join
Voss4911412

: How to redirect all pages and all subdomains of a domain to the home page of another domain I have an domain (www.aaa.com) and an alias (www.bbb.com). The alias domain points to the aaa.com

@Voss4911412

Posted in: #Domains #Htaccess #Subdomain

I have an domain (www.aaa.com) and an alias (www.bbb.com). The alias domain points to the aaa.com domain, but that's not what I want. I want bbb.com to point to ccc.com.
I have the following script in my htaccess file:

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


That works, but when I go to bbb.com/bla it is not redirected to ccc.com. It is redirected to ccc.com/bla. That's not what I want.
And when I go to bla.bbb.com, I get an error.

I was thinking: maybe it is possible to redirect to ccc.com if the string "bbb" is anywhere in the url to fix my problem.

Do you know a solution for this?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Voss4911412

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme