views:

12

answers:

1

I want to map subdomains to my wordpress tags. So when a user visits mytag.myblog.com, he should see the page myblog.com/tag/mytag (without redirect, though). This will require some modification of the wordpress code and setting up "catch all subdomains" for the domain in apache. The latter part should be no problem.

I found a plugin that does the above for the categories. It is called "WP Subdomains" (http://wordpress.org/extend/plugins/wordpress-subdomains/).

Does anybody know of a plugin that can do this for categories and tags?

A: 

You can do it manually with mod_rewrite:

RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([^.]+).example.com$ [NC]
RewriteRule ^$ /file.php?item=%2 [QSA,NC]

Sure you have to create a wildcard dns record (*.example.com), and setup an apache wildcard virtualhost, so all dns requests map to your host, and responded by your site from the server.

aularon
Okay. This will take care of the server part. But I also need to change the link structure in Wordpress to point to those subdomains.
reggie
I can't do much help with that since I don't know much about wordpress.
aularon