Solved How to Make the ip does not open My Site Or transfer of domain

I have a web freebsd through apache It is pegged to the Domain In godaddy
I've put ip freebsd server in place (@) and (www) in godaddy
It works well, but do not want to open the site Browser in IP
I want to make it work across in only domain
or When you put ip in browser transfer you to the Domain
_________
i have webmin i think i can do in it
I do not use dns
Can one help me?
I apologize for the English language I speak Arabic, only
 
It is hard to understand what you want. If you just want to stop the browser from responding to an IP request, then the easiest way is to put a redirect script on the default index.html

/usr/local/www/apache2X/data/index.html

Code:
<script language="javascript">
    window.location.href = "http://www.domain.tld"
</script>
 
It is hard to understand what you want. If you just want to stop the browser from responding to an IP request, then the easiest way is to put a redirect script on the default index.html

/usr/local/www/apache2X/data/index.html

Code:
<script language="javascript">
    window.location.href = "http://www.domain.tld"
</script>
did you have like this for php not html my web index.php not html i try it and my web not open
 
Not really. But you'll need to define two websites, like so:
Code:
<VirtualHost _default_:80>
 # This will be the website that's on the IP
 DocumentRoot /usr/home/default_site
...
...
</VirtualHost>
<VirtualHost *:80>
 ServerName www.example.com
 DocumentRoot /usr/home/example.com
...
...
</VirtualHost>
 
Not really. But you'll need to define two websites, like so:
Code:
<VirtualHost _default_:80>
# This will be the website that's on the IP
DocumentRoot /usr/home/default_site
...
...
</VirtualHost>
<VirtualHost *:80>
ServerName www.example.com
DocumentRoot /usr/home/example.com
...
...
</VirtualHost>

think you it work i put this in /usr/local/etc/apache24/httpd.conf

For php you will need something like the following. If you google a bit you will find many examples. But like SirDice said, defining a default virtual host will also work, even better.

Code:
header("Location: myOtherPage.php");
die();
think you two for help :) this code work two if i change server name like first
 
Back
Top