virtual hosts again

Jun 22, 2010 at 3:00 PM
hi, i am using the following rule to create a virtual host for users: RewriteCond %{HTTP_HOST} ^(?!www)([^.]+)\.mysite\.de [I] RewriteRule ^/(.*) /user.aspx?username=*1 [L,I] the rule is redirecting to the following url: http://user.mysite.de/user.aspx?username=user this changes my desired functionality because it should be redirecting to the following url: http://mysite.de/user.aspx?username=user any ideas on what i can do? cheers
Jun 23, 2010 at 5:45 PM
please does anyone have an idea about how i can modify this rule?
Jun 23, 2010 at 6:29 PM
please can you help me, i really need some help
Jun 23, 2010 at 6:52 PM
You have to make the RewriteRule absolute, or it will use the HTTP_HOST that the request is coming in on: RewriteRule ^/(.*) http://mysite.de/user.aspx?username=*1 [L,I]
Jun 23, 2010 at 7:19 PM
i've tried that but i get a 404.4 - no associated handler. the documentation also says you can't specify url schemes in a rewrite rule. perhaps i need to configure the handler mappings in iis?
Jun 24, 2010 at 1:35 AM
Try using RedirectRule
Jun 24, 2010 at 11:16 AM
using a redirect rule would send a response to the user agent and effectively change the value in the browser address bar, the user should not see the redirected url in their browser.
Jun 24, 2010 at 1:27 PM
Then you will have to use ProxyPass to transparently proxy to the new url
Jun 24, 2010 at 4:18 PM
tnx! that did the trick.