Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rewrite rule with parameters in subdomains

0 views
Skip to first unread message

BrainBurner

unread,
Nov 3, 2009, 2:42:07 PM11/3/09
to
Hi everyone,

I have serious problems configuring apache to do the following:
http://aaa-bbb.mydomain.com/test --> http://aaa-bbb.mydomain.com/test/index.php?param1=aaa&param2=bbb

I tried the following code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([A-Za-z]+)-([A-Za-z]+). [NC]
RewriteRule ^/test/?$ test/index.php?param1=%1&param2=%2 [L]
I don't know the reason, but I get an error 400 (Bad Request), when I
visit http://aaa-bbb.mydomain.com/test.
If I set the rewrite rule with [R,L] everything works fine, but I
don't want the parameters to appear twice (once in the subdomain and
then in the query string)!

Can you help me?

0 new messages