Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a web application running in JBoss on www.example.com:8080/webapp. I want users to be able to use the URL www.example.com/company and have that redirected to www.example.com:8080/webapp?name=company in order to present company specific logos and names for each client.

Can I do this using the rewrite engine? and use Apache as the redirect to JBoss?

share|improve this question

migrated from stackoverflow.com Jul 27 '11 at 8:49

This question came from our site for professional and enthusiast programmers.

marked as duplicate by MadHatter, HBruijn, Ward, mdpc, voretaq7 Jul 8 at 17:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

If you are using Apache, then give the following rewrite a try:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^/(.*)$ http://www.example.com:8080/webapp?name=$1 [R, 301]
share|improve this answer