• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 443
  • Last Modified:

domain redirection with cname or A

right now I can access my service only by IP address: XX.XXX.XXX.XXX:8080/NameHere/
I need to specify port and name of my app. Is it possible to cover that with subdomain entry?
I know that with a type A redirection I can get rid of IP address but is it possible to loose port and application name at the end?
2 Solutions
Hi there static,

You'll have to take this on one step at a time -- DNS can't take care of all your requirements. First I would suggest you create an A record so that you can refer to this host by name instead of by IP address. That will convert xx.xx.xx.xx to servername.company.com. Next, if this server does not already host something on port 80, then you could listen on port 80 for traffic and using an .htaccess file redirect your users both to the new port (8080) and the subdirectory/application name (/NameHere/).

That way, when a user hits servername.company.com with a browser, they are automatically redirected to servername.company.com:8080/NameHere/ .

If this makes sense, I can help you write a little .htaccess file to do your redirection.
No, port and app name cannot be inserted in the DNS entry as DNS manage the conversion from domains to ip but is not bound to any application.

You do not have to write www.yahoo.com:80 because your browser knows the port is 80, not dns.

You can do what you're asking for using apache and mod_alias or mod_rewrite + mod_jk if your app is on a tomcat

USER -------- APACHE on port 80 so no need for the url to include the port -------mod_jk------ tomcat
                    Can reconvert NameHere.domain.com to

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now