0

How to redirect domain to the ip with specified port instead of port 80 when accessing with browser?

For example, accessing example.com in browser will pointed to 127.0.0.1:33333

1
  • Where do you want to do the redirect? Do you control the webserver for the domain in question?
    – raj
    Commented Sep 5, 2022 at 10:32

2 Answers 2

2

This sounds like you want a 'Reverse Proxy'.

You can look at NGINX.

Or if you are looking for an easy personal option, look at CaddyServer.

0

There are several ways you can redirect the browser.

Something like this in the head section of your HTML file:

<meta http-equiv="refresh" content="0; URL='http://127.0.0.1:33333'" />

You could do it with Javascript:

window.location = "http://127.0.0.1:33333";

This site gives a great explanation of redirecting. I have it bookmarked...

https://css-tricks.com/redirect-web-page/#:~:text=A%20redirect%20is%20when%20a,%2Fpage%2Db%E2%80%9D%20instead.

hth,

David

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jan 9, 2023 at 14:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .