I have used my own domain and But the problem is that now my website is live on two different urls, one is my own domain name and the other is 000webhost sub domain which is a problem for seo of my website

I have used my own domain and But the problem is that now my website is live on two different urls, one is my own domain name and the other is 000webhost sub domain which is a problem for seo of my website. For example, How can I disable the 000webhost subdomain. Any help is appreciated.

Don’t give out the 000webhostapp, configuration of scripts to your new domain and if necessary then use .htaccess rules.

Can You help where can I find the .htaccess file. And also can you tell what to write in the file ?

Open public_html and you should see .htaccess

What is your personal new domain ?

RewriteEngine on
RewriteCond %{HTTP_HOST} ^YOURAPP.000webhostapp.com[NC]
RewriteRule ^(.*)$ http://YOURDOMAIN.COM/$1 [L,R=301,NC]

I THINK MIGHT WORK.
:grin:

1 Like

Can you tell me what is this code actually doing /…? That might also help!!!

If people visit your 000webhostapp by some weird way it’ll bump them onto your domain.

RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_HOST} ^YOURAPP.000webhostapp.com [OR]
RewriteCond %{HTTPS_HOST} ^https://YOURAPP.000webhostapp.com [OR]
RewriteCond %{HTTP_HOST} ^YOURDOMAIN.COM $ [NC]
RewriteRule ^(.*)$ http://YOUR DOMAIN.COM $1 [R=301,L] op

You cannot turn off the application URL on freeium.

1 Like

Ok Thanks for your help. Now I can decide what to do next…:slight_smile:

1 Like