Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9064487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:15:54+00:00 2026-06-16T16:15:54+00:00

So basically I have made a webapp with the following url www.foo.com/foo (when deployed

  • 0

So basically I have made a webapp with the following url www.foo.com/foo (when deployed locally, my app has the following url localhost:8080/foo/). However, I would like to use www.foo.com instead. How can I go about doing this? Thanks! I have an apache2 web server and tomcat 7.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:15:56+00:00Added an answer on June 16, 2026 at 4:15 pm

    This is nothing to do with Spring, Apache, or Tomcat. It’s all about name resolution, and it’s done by lower-level things in the OS. You can force http://www.foo.com to resolve to your local machine by modifying the localhost line in your hosts file so it looks something like:

    127.0.0.1 localhost www.foo.com
    

    On Linux, that’s in /etc/hosts. On Windows, you’ll find it at C:\Windows\System32\drivers\etc\hosts (thanks to @JBNizet for supplying this). Note that if you do this, though, you’ll no longer be able to get to the real http://www.foo.com because it’ll always resolve to your local machine.

    If you’re trying to do this because your app internally references “www.foo.com” and needs to have it resolve correctly in order to work, then you’re trying to solve that problem in the wrong way. You should pull those values out into some kind of external configuration so they can be set appropriately to the environment where the app is running.

    Update: If this just about deploying to the root context of tomcat, that’s been answered several times, like in Tomcat 6: How to change the ROOT application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made the following webpage for generating interactive todo lists: http://robert-kent.com/todo/todo.php Basically, the
basically i have $(msgbox .content).html(FOO); but i have made a plugin and need to
I want to introduce a cache policy in my app. Basically I have made
I have made a custom formwizard and incorporated it into my admin interface. Basically
I have an XDocument class with the XML contents already made. I basically want
I basically have the following string in the format: A,B,C:D,E,F What I am trying
Basically, I have made a function that selects a certain image to display depending
i have made the following animation xml file in my android project: <?xml version=1.0
We have this webapp product being deployed for multiple customers and think about switching
I have made this gem: https://github.com/RLovelett/feedzirra-rails I want to be able to include it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.