Clean URLs mod_rewrite & wildcard subdomains

Posted by Søren Zet on Stack Overflow See other posts from Stack Overflow or by Søren Zet
Published on 2012-11-10T00:32:11Z Indexed on 2012/11/11 23:00 UTC
Read the original article Hit count: 304

Filed under:
|
|

I got this url

http://domain.com/blogs/directory-param

with this rule

RewriteBase /blogs/directory/ RewriteRule ^/blogs/directory-([A-Za-z0-9-]+)$ /blogs/directory/index.php?cat=$1 [L]

so I get /blogs/directory/index.php?cat=param now my problem is the following:

I use wildcards subdomains so every *.domain.com is mapped to domain.com/blogs/ for example soeren.domain.com is mapped to domain.com/blogs and so on...

My problem now is I want a rule for soeren.domain.com/directory-param which points to domain.com/blogs/directory?index.php?cat=param

Do you have any ideas?

© Stack Overflow or respective owner

Related posts about php

Related posts about mod-rewrite