My website is appearing on two domains

Hi,

I am new to 000webhost and need some advice.

After setting up using my own domain (godaddy and change CNAME) I notice that my website can be accessed by two domains, which are https://digital-inferno.000webhostapp.com/ and http://www.digitalinferno.net/. For SEO purposes I don’t want this. How do I correct this? I am on the free service.

Thanks

1 Like

Can someone please help as I need this resolved as soon as possible. Also whats with all the SPAM in this forum, pretty alarming.

This has now been resolved. I guess it just takes 24 hours for the server to kill the old domain off

currently the solution is to create htaccess rule to make redirect.

also spam is cleared frequently. do not worry about it

i think you should use htaccess to fix the problem

1 Like

How but? Please can someone tell as i also want to know it

@ish12321 copy the below in your .htaccess file(file location “public_html”).
But replace “your” with yours *.000webhostapp.com.
and replace “yourdomain.com” with your domain.

RewriteEngine on
RewriteOptions inherit

RewriteCond %{HTTP_HOST} ^your.000webhostapp.com [OR]
RewriteCond %{HTTPS_HOST} ^https://your.000webhostapp.com [OR]
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com$1 [R=301,L] 

If you still have issues post back!!!

Hi
I try but my domain 000webhost still work.
My .htaccess file is:

HTID:713415: DO NOT REMOVE OR MODIFY THIS LINE AND THE LINES BELOW

php_value display_errors 1

DO NOT REMOVE OR MODIFY THIS LINE AND THE LINES ABOVE HTID:713415:

RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_HOST} ^obedhigueratinoco.000webhostapp.com [OR]
RewriteCond %{HTTPS_HOST} ^https://pbedhigueratinoco.000webhostapp.com [OR]
RewriteCond %{HTTP_HOST} ^obedhigueratinoco.xyz$ [NC]
RewriteRule ^(.*)$ http://www.obedhigueratinoco.xyz $1 [R=301,L]

Working fine on my end !!!
Now try the below one…

RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_HOST} ^obedhigueratinoco.000webhostapp.com [OR]
RewriteCond %{HTTPS_HOST} ^https://pbedhigueratinoco.000webhostapp.com [OR]
RewriteCond %{HTTP_HOST} ^obedhigueratinoco.xyz$ [NC]
RewriteRule ^(.*)$ http://www.obedhigueratinoco.xyz $1 [R=301,L]

Yep obedhigueratinoco.000webhostapp.com is pushed/redirected to show obedhigueratinoco.xyz instead :smiley:

Powered by Zyro.com

ErrorDocument 401 "Unauthorized"
ErrorDocument 403 "Forbidden"
RewriteEngine On
RewriteBase /

PERSISTENT CONTENT

DirectoryIndex index.php index.cgi index.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ zyro/$1 [L,QSA]

this is already in…
what of this ? :

try replacing those “PERSISTENT CONTENT”…with the above http rewrite rule.