How to redirect 000webhostapp site to my actual site?


#1

Hello! I just bought a .com domain and I use a cname record through cloudflare to point my domain to my 000webhostapp site. My 000webhost site appears higher on google search results and I would like my .com domain to appear, not my 000webhostapp site.

Is there any way to put a redirect on my example.000webhostapp.com site to go to my example.com site so I don’t have these issues?


#2

You’ll need some htaccess rules


#3

Thanks :slight_smile: such as…?


#4

Nevermind, I got it to work :slight_smile:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.000webhostapp\.com$   [NC]
RewriteRule ^ http://example.com [L,R]

#5