How to show my domain URLs only?


#1

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


#2

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.


#4

Your code did not work.


#5

Did you replace the example.com ?


#6

Yes, I did replace the URL with my own.


#7

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.


#8

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?


#9

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


#10

I’m using WordPress.


#11

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


#13

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.


#14

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


#15