Forum Moderators: phranque
The examples:
tim.example.com -> should be redirected
www.tim.example.com -> should be redirected
So I have tried like a million of redirect combinations, but none of them seem to work with both examples. In the end I thought it worked but I got an Apache error stating an infinite proxy loop.
If you now what to fill in the lines below, you are my hero :)
RewriteEngine on
# rewrite rule
------ THESE DO NOT WORK, WHAT SHOULD THEY BE? ------------
RewriteCond %{HTTP_HOST} ([^.]+)\.example\.com [NC]
RewriteRule ^(.*) http://localhost/example/account.form?account=%1 [P]
-------------------------------------------------------------
<IfModule mod_proxy.c>
<Proxy /index.html >
Order deny,allow
Deny from all
</Proxy>
<Proxy /example >
Order deny,allow
Deny from all
</Proxy>
ProxyPass /example ajp://localhost:8009/example/
ProxyPassReverse /example ajp://localhost:8009/example/
</IfModule>
[edited by: jatar_k at 2:37 pm (utc) on Jan. 15, 2008]
[edited by: jdMorgan at 2:44 pm (utc) on Jan. 15, 2008]
[edit reason] please use example.com [/edit]
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteRule .* http://www.example.com/example/exampaccount.form?account=%1 [P,L]
Thanks again
[edited by: engine at 2:17 pm (utc) on Jan. 17, 2008]
[edited by: jdMorgan at 3:00 pm (utc) on Jan. 17, 2008]
[edit reason] examplified [/edit]