Wordpress Category as Subdomain Plugin
This is a plugin which I adapted from an older version (see History). I made the required adaptations to Wordpress 2.6.2 about a month ago after I saw that it isn’t properly working and that comments on the developer’s blog go unanswered.
I debated releasing this plugin for a couple of weeks but after seeing so many people trying to get it to work I decided to release it on my blog. My personal project relied heavily on sumdomained pages and this function has been tested in full. The category part of this plugin, while adapted and seems to work properly has not been fully tested by me and I would appreciate any comments about any problem you may have ran into.
Description:
This plugin will take a category of your choice (i.e. www.myblog.com/some-category/) and will turn it into a subdomain (i.e. somecategory.myblog.com/).
History:
This plugin was initially written and released under the name Subster Rejunevation by Dax (aka BiggNuts) and maintained until version 2.1 of Wordpress.
Next Adam Dempsey took a stab at adapting it for Wordpress 2.5, however, according to the comments the plugin did not work properly beyond Wordpress version 2.2.2.
I took this plugin, adapted all functions to work properly on Wordpress 2.6.2 and released on 9/20/08.
Todo:
Subdomain tags
Download:
* Version 0.44
Related Entries:
Web Hosting Coupon Codes wrote:
Great Ill test this plugin and see if it works
[Reply]
Posted on 21-Sep-08 at 11:18 am | Permalink
selise wrote:
thank you for releasing this plugin. i will give it a try and report back.
do you know if it is possible to map 2 categories to the same subdomain?
many thanks,
selise
[Reply]
Posted on 22-Sep-08 at 7:18 am | Permalink
selise wrote:
ok, i gave it a first try, and there is one problem - although i’m not sure it should be called a bug:
all the categories get turned into subdomains - that won’t work as i need to have some categories used just for the main domain.
i expect i’m not alone in needing to have some categories not turned into subdomains. so here’s a suggestion:
do with categories, just as you do with the pages:
“To make pages act as subdomains set a custom field with the key of subdomain_me to “true”
To tie a pages to a category subdomains set a custom field with the key of tie_to_category to to category ID”
1. do not turn a category into a subdomain unless a custom field with the key of subdomain_me is set to “true”
2. permit multiple categories to be tied together in one category’s subdomain by setting a custom field for the categories with the key of tie_to_category to the category ID of the shared subdomain.
item 1. above is the most critical. without it, i can’t use the plugin for categories. i hope that is something you can easily add - and i’ll be anxiously awaiting the chance to try it again.
best,
selise
[Reply]
GiladG Reply:
September 23rd, 2008 at 12:43 pm
Item 1: There is a “Make Subdomain” option as a part of the “Edit Category” page. However, it is not a part of the “Add Category” page. So all you’ll need to do is create the category and then edit it to determine if it is to be sub-domained or not.
*I will look into adding it to the “Add Category” as well.
Item 2: I am not sure I understand what it is you with to do. Have a category “Cars” and category “Morotcycle” and have posts from both appear under “cars.mysite.com”?
[Reply]
selise Reply:
September 23rd, 2008 at 5:00 pm
Thanks!
item 1: i did not look at the “edit category” page - will give that a try.
item 2: yes. that’s it exactly.
[Reply]
Posted on 22-Sep-08 at 8:47 am | Permalink
selise wrote:
some preliminary testing notes:
a) i already have lots of categories - and lots of subcategories, most of which i don’t want to be subdomains. if there is any easy way for you to have the categories default to not having the “Make Subdomain” box checked that would be helpful - but not necessary. i can go through and edit all of them to uncheck the box.
b) i’m confused about the way subdomains are handled. i have a parent category that i want to use a subdomain for. if i both the parent category and subcategories checked for “Make Subdomain” then the urls for individual posts are changed
from:
to:
but shouldn’t it be:
new item: i get an error msg:
for links to category pages:
it is only in the category sidebar widgets than the redirection seems to happen correctly.
another new item (small):
also on the edit category page, the link:
gives the following error msg:
….
many thanks again,
selise
[Reply]
Posted on 24-Sep-08 at 3:32 am | Permalink
z33j wrote:
I don’t know what i’m doing wrong but it’s not working for me. I enabled “Make Subdomain” for a category, and when i click on it on my blog (categoryname.sitename.dk) i get the error; “Not Found
The requested URL / was not found on this server.”
[Reply]
GiladG Reply:
September 26th, 2008 at 5:05 am
Did you enable “Wildcard Subdomains” on that domain?
[Reply]
Posted on 26-Sep-08 at 2:28 am | Permalink