My website is appearing on two domains


#1

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


#2

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


#3

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


#4

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

also spam is cleared frequently. do not worry about it


#5

i think you should use htaccess to fix the problem


#6

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


#7

@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!!!


#8

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]


#9

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]

#10

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


#11

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 ? :


#12

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