How to show my domain URLs only?

I parked my domain name at 000webhost. How can I get visitors to see my domain name only? In other words, I don’t want my website directed to 000webhost. Thanks

You have to add this code to your .htaccess file

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.net/$1 [L,R=301,NC]

Replace example.com with your old domain, and http://example.net with your new domain.

Your code did not work.

Did you replace the example.com ?

Yes, I did replace the URL with my own.

After adding that piece of code you then need to clear you browser cache and data to see some action. :slight_smile:
Else you can use “Private or Incognito” mode in browser to test.

Definitely, your code did not work. I clearly the browser’s cache to no avail. Are you sure I just need to add this code? No need to delete the existing or part of the existing code?

Hi what is your website url? Are you using any forum or WordPress or any CMS?

I’m using WordPress.

You have to change your URL in WordPress also. Go to settings>>general>>change both urs and then go to database phomyadmin and click on wp-option and change your siteurl

1 Like

Thank you, Ayu. After changing the site url in settings, the issue has been resolved. To others experiencing the same issue: There was no need to redirect in .htaccess, only change the site url in Admin.

Glad to hear that :slight_smile:
Do post again anytime :smile: