What is the output of curl -I
for that domain? That should show you the headers with a possible explanation. Run it like this:
curl -I my-fake-domain-name.com
And what shows up in the web server (I assume Apache?) logs on the server at my-fake-domain-name.com
? These logs should be located in:
/var/log/apache2/access.log
/var/log/apache2/error.log
And you can follow their output using tail
like so:
sudo tail -f -n 200 /var/log/apache2/access.log
sudo tail -f -n 200 /var/log/apache2/error.log
These paths are based on a standard Ubuntu 12.04 install, but should be the same for CentOS & whatever Linux variant you are using if you are on Linux.
Assuming it is Apache running on the server, do you have Apache name-based virtual hosts in place? It could be you are getting a success for 192.168.1.111
because that is the Apache default config returning data, but of you have an Apache name-based virtual host config in place for my-fake-domain-name.com
and that Apache config is broken it could cause the 403: Forbidden
error.
EDIT: And since the original poster in the comments indicates the issue could be with the PHP code itself, there could be an error within the PHP code itself that could cause the 403. Perhaps .htaccess
related as well?
ANOTHER EDIT: In your comments you say you have ServerAlias
set like so:
ServerAlias my-fake-domain-name.com
But you seem to be missing ServerName
:
ServerName my-fake-domain-name.com
This is a pseudo-code example of how I would setup a virtual host like this:
<VirtualHost *:80>
DocumentRoot /var/www/my-fake-domain-name.com/site/
ServerName my-fake-domain-name.com
ServerAlias my-fake-domain-name.com
ErrorLog /var/log/apache2/my-fake-domain-name.com.error.log
CustomLog /var/log/apache2/my-fake-domain-name.coml.access.log combined
</VirtualHost>