[thelist] mod_rewrite redirect to external URL

Pete Freitag pf at cfdev.com
Tue Jul 27 08:15:31 CDT 2004


Maximillian Von Schwanekamp wrote:

> How can I use mod_rewrite to redirect something like this:
> /mydirectory -> http://otherdomain.com/some/arbitrary/file.htm
> /* -> http://otherdomain.com/
>
> For the first one, this works fine:
> RewriteRule ^mydirectory(.*) 
> http://otherdomain.com/some/arbitrary/file.htm
>
> But I cannot seem to negate the "in all other cases" rule to work 
> properly.  Help?
>
> TIA!

Try /.* for your pattern.
______________________________________
Pete Freitag
http://www.cfdev.com/
Author of the CFMX Developers Cookbook
http://www.petefreitag.com/bookshelf/




More information about the thelist mailing list