• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

virtual host that adds a requestparameter to url

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I'm trying to figure out how I can set up a virtual host that simply adds a request-parameter to my localhost-url.
I have a local website: localhost/mywebsite

Now I want to add the possibility that I enter localhost/websiteA which sort of automatically "forwards" me to localhost/mywebsite/?rq_param=websiteA and
localhost/websiteB to localhost/mywebsite/?rq_param=websiteB.

I think this is done by virtual hosts, isn't it? How?

Thanks in advance,
M*
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A virtualhost is what would support urls like "http://websiteA/myapp" and "http://websiteB/myapp". In other words, 2 different hostnames.

The URLs "localhost/mywebsiteA" and "localhost/websiteB" correspond to 2 different webapp contexts on the same host (localhost).

Actually rewriting URLs can be done in a number of ways. If the primary webserver of the machine is Apache httpd, for example, you can use mod_rewrite, mod_proxy, mod_jk, and so forth. If you wish to do the rewriting in Tomcat itself, that would generally be handled via a custom Valve.
 
reply
    Bookmark Topic Watch Topic
  • New Topic