[development] mod rewrite rules question

Ashraf Amayreh mistknight at gmail.com
Wed Mar 3 08:30:01 UTC 2010


Hello all,

If this is not the right place for this question I appreciate if someone
points me to some resources or mailing lists where I can ask. I have a
couple of rewrite rules that simply refuse to work. Without too much noise,
I'll post them here:

RewriteCond %{HTTP_HOST} !^apps.example.com
RewriteCond %{HTTP_HOST} ^(.*).example.com
RewriteRule ^(.*)$ ${res:%1}/$1 [QSA]

The logic here is:

1. make sure the URL does not start with apps
2. isolate the first part of the URL and send it to an external app: The
external app either returns "members/<subdomain>" or nothing. The
alternative return values in the app are:
    print "\n"; OR
    print "members/{$subdomain}\n";
3. That's it.

The idea is that if I provide a subdomain such as:
- abc.example.com, I want it to pass through unchanged
- def.example.com should be rewritten to def.example.com/members/def

Am I doing something wrong here? Debugging rewrite rules seems to be
something next to impossible so I'm left without many alternatives than to
ask someone more knowledgeable than me.

-- 
Best Regards,
Ashraf Amayreh
CEO | O-Minds
Cell. 962 78 8099997
Tel. 962 6 5655150
Fax. 962 6 5675150

o-minds.com
web development | web design
user experience | branding design
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100303/3757a2a6/attachment.html 


More information about the development mailing list