This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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 ]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Conditionnal mod_rewrite - How to ?
 
It's not a secret anymore!