Subdomain like mod rewritten URLs ...possible?

Hello Forums,

I was wondering if it’s possible to create a subdoimin like mod rewrite URL structure for author pages in wordpress.

Something like:

To:

Thanks

Assuming you’re using Apache, you can add something like the following in a .htaccess file at the root of your site:

RewriteCond %{HTTP_HOST} !^www\\.thesite.com$
RewriteCond %{HTTP_HOST} ^(.+)\\.thesite.com$
RewriteRule ^ http://www.thesite.com/author/%1 [L]

The first condition checks that the visitor is not on the www. subdomain
The second condition captures the subdomain
The rewrite rule then rewrites the request, using the previously captured subdomain value

sd,

Typically, subdomains are created via a DNS mod, NOT via the server daemon. Therefore, I would not expect dj’s code to actually create a new (sub)domain.

Note, some members have mentioned “wildcard” subdomains but I have no experience with an unusual setup like that so I’d suggest that you contact your host’s support team.

Regards,

DK

Yes, that’s quite correct. You’d need to have the subdomains already set up.