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:



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\\$
RewriteCond %{HTTP_HOST} ^(.+)\\$
RewriteRule ^ [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


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.



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