IntelliJ Java IDE
The moose likes Tomcat and the fly likes using mod_redirect and retaining full URL Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "using mod_redirect and retaining full URL" Watch "using mod_redirect and retaining full URL" New topic
Author

using mod_redirect and retaining full URL

Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Can I have Apache do something like this?

http://xyz.mydomain.com/foo1/foo2
redirected to:
http://xyz.mydomain.com/xyz/foo1/foo2

Where foo1 and foo2 are dynamic, but xyz is a constant value.

I've seen plenty of examples that redirect a domain to a new domain, or a page to a new page. But nothing that just uses a regex type switcheroo. Am I looking at using mod_rewrite? Which makes me shudder, seeing as how I'm so very good at regex.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695


I think this is what I'm looking for ?

But I only want this to work for the xyz.mydomain.com virtualhost and I also only want to do this if /xyz isn't already in the URL. So the rewrite would happen the first time someone hits the site, but not again, unless they remove the /xyz/ from their address bar.

Anyone with any Apache config experience want to show me the way?
[ May 26, 2003: Message edited by: Mike Curwen ]
 
 
subject: using mod_redirect and retaining full URL
 
Threads others viewed
AJAX Apache redirect doesn't work
JSP page not coming
Query regarding split function in Java
URL Redirecting in iPlanet Web Server 4.1.11
HashMap's Map.Entry interface
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture