Under windows 7, I can not use default port 80, so 81 instead.
I configured my httpd.conf, like:
<VirtualHost *:81>
DocumentRoot "G:/bitnami/htdocs/test"
ServerName test.dev
ServerAlias test.dev www.test.dev
<Directory "G:/bitnami/htdocs/test">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I can only access the site with test.dev:81, but not test.dev or http://www.test.dev
It seems that ServerAlias do not do anything when port is not 80.
I have added relevant code to my hosts file, but no use:
127.0.0.1 127.0.0.1 localhost test.dev www.test.dev
How to force apache server URL with port appended? I want test.dev, but not work
Thanks
As far as I know you can’t. Quoting from RFC1738, the URL specification:
This means that if the port number isn’t specified in the URL, the default port is implied. For http the default port is 80, so any other port has to be specified.