i want to redirect all requests like this:
to this (removing the
so far i do it like this: for each of my apps i create an extra static app bound to 'www.site.com'
containing only is there a cleaner solution? thanks asked 03 Jul '11, 05:43 junggle |
Assuming that the application mounted at answered 03 Jul '11, 05:49 David L ♦♦ |
Here's a generic rewrite that you can use rewrite any www subdomain to its parent domain.
So, with this you can:
answered 04 Jul '11, 19:35 seanf I haven't used rewrite like this before. Thanks for this. Now I'll have a neater list of apps.
(05 Jul '11, 02:16)
bloodpet
perfect answer. I especially love that you're doing this with a single rule for any domain.
(06 Jul '11, 15:11)
swiharta
|
I'd also want a clean solution for this. I've tried just using one app for all my sites, and add this to the .htaccess:
But that didn't work. I hope somebody has found a way.
That won't work, for a couple of reasons:
The trick is to add a second criteria to the rewrite condition to catch the domain, and then reference that with a % variable in the rewrite rule. See my answer below for a working example.