Map subdomains to wordpress tags
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 p开发者_开发技巧roblem.
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?
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.
精彩评论