is there a way so i can set pathauto or modwrite or code or somehting... so i have username.domain.com as my profile page??

right now, the profile looks like domain.com/user/username

also i want blogs.domain.com to be accisible by username.domain.com/blog

i am using wordpress for my blog service.. and i have kinda figured out the way to share login between them... i will post it, once i am sure thats the right way to do it..

but for now.. any mod_rewrite experts.. please... help...

Comments

test111’s picture

i have a fully functional user/content driven site. i use .htaccess to re-write urls so that my users each have a unique url (domain.com/username) and all of their content exists under that (domain.com/username/post). this is all working correctly.

i recently started creating virtual hosts and re-directing many domains to the same directory using the vhosts.conf file. this is working just fine. on the front end i am looking up my customer's unique credentials based on that incoming domain in mysql. this too, is working correctly.

now comes my issue. i need to have two different rule sets in .htaccess. one rule set for users coming from external domains and one rule set for users who do not have external domains.

i have one customer set who will be using:
domain.com/username
domain.com/username/post

and another set using
personaldomain.com
personaldomain.com/post

my current re-write rules look like this:
## RULE FOR USER'S POERSONAL PAGE [url: /username]
RewriteRule ^([a-zA-Z0-9_-]+)\/?$ index.php?url=$1

## RULE FOR USER'S POST PAGE [url: /username/123]
RewriteRule ^([a-zA-Z0-9_-]+)\/?([0-9]+)?\/?$ index.php?url=$1&pid=$2

because i am assuming that the username will always be the first attribute in the url when the domain redirection happens, i loose the re-write paths. i need to have a conditional statement in the .htaccess file. if i were to write this in php, it would look something like this:
if($_SERVER['SERVER_NAME'] != "domain.com") {
//do all external domain activities
// assume: domain.com/username/post
} else {
//do the normal activities
// assume: personaldomain.com/post
}

i am fine with creating unique instances for each possible url attribute, but i need to know how to sniff for an external domain before hand.