2

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>

1

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.

  • woow thanks lot it's working... i change port number 90 to 80..thank you... but some times web site not loding "can't reach web site" error message showing..but in my vps web site working properly.why is that? – androidpc Oct 16 '18 at 12:02
  • Do you have more than one A record in DNS? If you have an extra second A record it could get used some of the time and cause the problem. – Stephen Ostermiller Oct 16 '18 at 12:44
  • hmm so how i solved this problem? – androidpc Oct 17 '18 at 4:50
  • Did you check your DNS records? I'm not sure if that is the issue, but it should be easy to check if there is an extra DNS record. – Stephen Ostermiller Oct 17 '18 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.