问题原文
原帖链接 · androidpc · CC BY-SA 4.0
I need a help for the remove port number from the URL. I host a site on VPS using xampp virtual host. Everything is working perfectly,but cant access domain without port number EX:
www.example.com:90
This URL is working but I need to remove this port number. The correct URL should be:
www.example.com
Here is my xampp vhost file code
<VirtualHost *:90>
ServerName abc.com
ServerAlias www.abc.com
DocumentRoot "C:\xampp\htdocs\abc.com\public"
ErrorLog "logs/abc.com-error.log"
CustomLog "logs/abc.com-access.log" common
<Directory "C:\xampp\htdocs\abc.com">
Require all granted
Order allow,deny
Allow from all
</Directory>
已采纳解答
原帖链接 · Stephen Ostermiller · CC BY-SA 4.0
Change the port number from 90 to 80 to remove it from the URL. The default port number for HTTP is port 80. If you use any other port number, that port number has to be specified in the URL.
Similarly if you use HTTPS (with an SSL certificate) your port number has to be 443 if you don't want the port number to appear in the URL.
For HTTP and HTTPS it is not possible to use any method other than the URL to change the port number. Some newer protocols use SRV DNS records to set the port number, but HTTP and HTTPS do not support that. See Can DNS point to specific port?
If your ISP or hosting company has blocked port 80, you are out of luck. That shouldn't be the case for any VPS though.
If you are running another web server on port 80 already, you will need to combine the two. That can usually be accomplished easily by using reverse proxy from one web server to another.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
