This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Conditionnal mod_rewrite - How to ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Conditionnal mod_rewrite - How to ?" Watch "Conditionnal mod_rewrite - How to ?" New topic
Author

Conditionnal mod_rewrite - How to ?

Franck Tranchant
Ranch Hand

Joined: Aug 07, 2003
Posts: 75
Hi

I'm very new at mod_rewriting and i wonder how i could set up this kind of logic :

if (url.contains("aaa")){
redirect http://www.my_first_domain.com
exit
}
if (url.contains("bbb")){
redirect to http://www.my_second_domain.com
exit
}

Could someone give me the first steps ?


Franck<p>--------------------
Franck Tranchant
Ranch Hand

Joined: Aug 07, 2003
Posts: 75
Just in case someone is interested, I find a simple way to do that using only RedirectMatch. Actually, RewriteCond + RewriteRule were not necessary.

Instructions below work fine :


So simple..

[ October 04, 2006: Message edited by: Franck Tranchant ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Conditionnal mod_rewrite - How to ?
 
Similar Threads
java web site
POST and REDIRECT IN STRUTS 2...Need Help
redirect link in apache conf
How to redirect to another page
Getting the applet to die on exit...