Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

using mod_redirect and retaining full URL

 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic