WP Subdomains 0.6.0 Released

Just to let you know that Wordpress Subdomains 0.6.0 is released.

Sorry for the delay. I wanted to release this some time ago, but I kept adding new features, and then the end of term exams and my holiday got in the way.

New Features:

  • Add author subdomains
    • Turn this on and http://alex.mydomain.com will show all the posts written by alex. Just like going to http://www.mydomain.com/author/alex.
  • Keep links to non-subdomain pages that are not tied to a category on the subdomain we’re viewing
    • For example if you have an about page, and you’re on the http://movies.mydomain.com subdomain. Then the link to about will be http://movies.mydomain.com/about, therefore keeping the reader from being bounced back to the main site.
  • Date Archive filter
    • let you choose to have date archives filtered down to the category or author of the subdomain you’re on. Will also show the correct count in the date archive widget.
  • Added plugin settings options to turn on/off:
    • All Plugin Functionality
    • Date Archive Filter
    • Page Subdomains
    • Author Subdomains
  • Display warning and disable plugin if no permalinks setup
    • Should cut about 50% of the calls for help I get.
  • Support permalinks with %category% in
    • Much needed for all the people who use /%category%/%postname% or similar permalinks. I don’t use this permalink on this site so I’m relying on these users to let me know if there are any bugs in this I missed.
  • Custom Link title for Category Subdomains
    • Lets you pick a custom title to appear as the link text to the category instead of the category name.

No major bugfixes apart from one that made the All in One SEO plugin not work correctly. There are various code improvements where I realised there were wordpress functions I could use for things I was trying to do.

For all the people asking for help. I will get to you, but right now I’m relaxing in Thailand, so you’ll need to be patient. I will also be creating a proper HOWTO which should hopefully make things a little easier.

Related Pages:

Comments (38)

GaryFebruary 2nd, 2009 at 12:41 am

Great job on the plugin. Everything works fine for me running WP 2.7, however, when I try to use a different theme for the subdomain, the page shows is blank. I added the custom field variable and set it to the theme I want for the subdomain, but the page goes blank when I try this. The custom theme appears when I click on Page Configuration in the Subdomains configuration area. Maybe a bug?

Alex StansfieldFebruary 2nd, 2009 at 1:10 am

Hi Gary,

be sure that you’re typing the name of the theme correctly and in the right case. The best way to be sure is to edit a category. Look at the custom theme selector and copy exactly how the theme you want is written. In the future the page setup will have a dropdown like this to make things easier.

Cheers, Alex

GaryFebruary 2nd, 2009 at 1:20 am

Awesome! It worked. I just had the first letter capitalized and I changed it and it works!

Thanks!
Gary

Adam DempseyFebruary 2nd, 2009 at 1:33 am

Keep links to non-subdomain pages that are not tied to a category on the subdomain we’re viewing

Won’t that cause duplicate content == bad in google’s eyes?

Alex StansfieldFebruary 2nd, 2009 at 1:38 am

Adam,

I did wonder about that and have decided to release an update in the next day or two that makes it configurable. If you have any other SEO concerns do let me know. I will be making a post in the next few days asking people for their opinions on the plugin’s SEO features. What it does wrong, what could be improved, etc.

Cheers, Alex

GaryFebruary 2nd, 2009 at 4:58 am

Alex,

I just set up several subdomains connecting them to Pages. But I noticed randomly WP seems to be adding a permalink to the page (ie. http://www.domain.com/page/) so in the Sidebar, the Page links go to the http://www.domain.com/page/ instead of the subdomain I set up. The subdomain Page still works, but the links go to the other page.

My permalinks are set custom to /%post_id%/%postname%/ (I don’t know if this has anything to do with it).

Any ideas?
Gary

Alex StansfieldFebruary 2nd, 2009 at 9:42 am

Hi Gary,

When you say randomly do you mean that every page refresh it’s different links that aren’t correct or is it always the same links? Is this seen on the homepage or other pages?

Cheers, Alex

GaryFebruary 2nd, 2009 at 11:20 am

Hi Alex,

I mean I added 17 or so subdomains and I just went down a list and added new Pages and added the custom field. When I was done, about half of the Pages had permalinks (randomly) with the sidebar showing links to the subdirectory (www.domain.com/page/ and not the subdomain. So I went back in and looked to make sure I did everything correctly and I did, so I deleted the pages in question and tried again and the same thing happened. As a workaround, I’m just adding html links to those subdomains instead of the sidebar widget.

Gary

Alex StansfieldFebruary 2nd, 2009 at 11:49 am

Hi Gary,

all of the pages are main pages, in other words not children of other pages?

It’s always the same pages that caused problems?

Is it the dietsecrets.com website that has the problem or another?

Cheers, Alex

GaryFebruary 2nd, 2009 at 12:53 pm

Alex, all the pages are main pages, not children of other pages. When I deleted the pages and re-entered them, some pages ended up behaving this way and some did not (they changed from the first time around). I tried to isolate what could be causing it, and the only thing I can tell is that WP is somehow assigning a permalink to certain Pages that I add and not to others. The ones with the permalink are the ones that end up having a link to the subdirectory and not the subdomain.

And the site is not the dietsecrets site, it’s another one. Check it out here: http://www.com-freetrial.net. But on the home page, I removed all the Pages links and just added links using the text/html sidebar widget (as a workaround).

Gary

Alex StansfieldFebruary 2nd, 2009 at 7:43 pm

Hi Gary,

this is quite concerning to me as this should work fine. Is there any way you can export your database, zip it up and send it to me?
If so I’ll send you an email address to send it to.

Cheers, Alex

GaryFebruary 2nd, 2009 at 10:59 pm

Alex,

Sure I can do that. Please email me your email address and I’ll send it over. Also, when I commented out the line “line $link = $wps_this_subdomain->changePostLink( $link );” that you recommended in your bug fix post, all of the Pages changed to having permalinks. In other words, before making this change to the filters.php file, there were a couple of Pages that didn’t have permalinks and the links showed up correctly to the subdomain. But once I changed the filters.php file, those few pages then changed and a permalink was added to a subdirectory, yet they forwarded correctly to the subdomain.

Gary

Alex StansfieldFebruary 3rd, 2009 at 1:21 am

Hi Gary,

just so I get this straight. When you comment out the line all the page links stop working and link to the normal wordpress location for a page rather than a subdomain one?
I’ve sent you an email, just reply and attach the database and I’ll do my best to get to the bottom of this.

Cheers,

Alex

GaryFebruary 3rd, 2009 at 1:28 am

Hi Alex,

Prior to commenting out the line, there were I think around 2 or 3 Pages that correctly linked to the subdomains (http://page.domain.com) and when I looked at the pages in WP (edit the Page), they did not have permalinks. After I commented out the line, those 2-3 links changed to point to subdirectories (http://www.domain.com/page/). I then looked at the pages in the WP admin again and those pages had permalinks generated for them. But when I click on the links from the home page, they redirect to the subdomain, even though the links pointed to the subdirectory.

Hopefully that all makes sense.

Gary

GaryFebruary 3rd, 2009 at 1:29 am

Ooops… replied outside of the thread again. See reply below.

Gary

Alex StansfieldFebruary 3rd, 2009 at 1:34 am

Hi Gary,

Ok, it seems that it’s linking to the wrong place but the redirect feature that catches people going to old urls is correctly forwarding you on to the subdomain. Something is obviously wrong with the code that makes the link in the first place.
I just wanted to check. The line you commented out was line 38 of the filters.php file?
Look forward to receiving your database and hopefully then I can figure out what is going on.

Cheers,

Alex

GaryFebruary 3rd, 2009 at 1:41 am

Alex,

I made a mistake and commented out the wrong line. I commented out line 26. I fixed it now so I’ll try deleting and re-creating a page now to see how it behaves.

Gary

Alex StansfieldFebruary 3rd, 2009 at 1:43 am

phew, I was starting to think maybe it was time to give up coding and go into teaching english full time ;)

GaryFebruary 3rd, 2009 at 1:49 am

Great news… I think commenting out line 38 did the trick. I just re-added 4 Pages and they all correctly link to the subdomains. I’ll keep testing and if I see any more weird behavior I’ll let you know.

Thanks again for the help and the killer plugin! :)

Gary

GaryFebruary 3rd, 2009 at 10:34 am

Alex, I hate to break this, but I spoke too soon. It’s doing the same thing, even after commenting out line 38. I just added 11 more subdomains and the first four that I entered earlier today that previously worked correctly have now changed to subdirectories (www.domain.com/page/) and of the 11 I just re-entered, 5 worked correctly and link to the subdomains and 6 link to subdirectories. When I click to edit the pages, the pages that correctly link to the subdomains do not have a permalink and the others do.

This is very strange behavior because I did nothing to the 4 pages that worked correctly earlier, but somehow they now point to subdirectories.

I’ll send over the DB in an email. Hopefully it will help to troubleshoot this.

Gary

digitcriticFebruary 3rd, 2009 at 11:47 am

I still don’t understand how you install it. I created a subdomain for every category in my cpanel but all I get is a 404 error

Alex StansfieldFebruary 3rd, 2009 at 12:25 pm

Hi,

I just took a look at your digitcritic.com site. try adding two more posts. one for reviews and one for uncategorized and see if going to the reviews subdomain shows just the posts in the review category. Currently you only have one post and it’s in two categories which makes it hard to see if this is working or not.

Cheers,

Alex

digitcriticFebruary 3rd, 2009 at 12:31 pm

Ok I did it but i still get a 404 error so I can’t see if it is working

Alex StansfieldFebruary 3rd, 2009 at 1:34 pm

Hi,

I don’t get a 404. When I go to
http://reviews.digitcritic.com/
or
http://uncategorized.digitcritic.com/
They seem to show what they are supposed to.

What links are giving you a 404?

Cheers, Alex

digitcriticFebruary 3rd, 2009 at 1:50 pm

hmm, the 404 errors are gone now. Thanks for your help

digitcriticFebruary 3rd, 2009 at 1:59 pm

Another question. Is it possible to use subcategories as subdomains? so for example I have reviews category as main category and ebook reviews as subcategory.

post in reviews – reviews.domain.com/postname
post in ebook reviews ebook-reviews.domain.com/postname

Alex StansfieldFebruary 4th, 2009 at 1:34 am

Hi,

I’m afraid subcategories can’t be turned into subdomains. I figured it would make things too complicated and really if you wanted a category to behave on it’s own as a subdomain then it really should be a main category than a subcategory.

Cheers, Alex

GaryFebruary 5th, 2009 at 12:00 am

Hi Alex,

Any luck yet nailing down the problem I’m having with the permalinks going to subdirectories instead of the subdomain?

Gary

oliFebruary 7th, 2009 at 3:07 pm

Hi Alex,
First off, thanks for what looks and sounds like an awesome plugin.
I have installed it which seemed fine (WordPress MU 2.7) and I have set up 3 subdomains: all using main categories.

However, I have 2 stumbling blocks:

1. The plugin settings page doesn’t work – when I save it I get an error message (Error! Options page not found.) while it’s looking for this file /wp-admin/options.php
2. (most important to me) is that when i arrive at the subdomain it just thinks I’m asking get a new blog and I get wp-signup.php

I have my subdomain pointing to the document root in cPanel (not exactly sure which level to point it at to be honest – but I picked public_html)

Not sure what else to do.
I’d love to use this plug, please help if you can.

(website has just begun so it’s not in a good state)
http://www.naturalplanet.ca – yellowstone.naturalplanet.ca (my subdomain)

Cheers
Oli

Alex StansfieldFebruary 9th, 2009 at 2:33 am

Hi Oli,

So far I have no current plans to support Wordpress MU. I’m not saying it wont happen, but right now I’m concentrating on getting it all working on standard wordpress. When I have the time though I will give wordpress mu a quick go incase it’s a quick fix.

Cheers,

Alex

Scott LindseyFebruary 12th, 2009 at 1:43 am

I think I’ve figured out what’s going on here. It’s a security feature that’s enable in MU and will be in a “near-future version of WordPress”.

http://maisonbisson.com/blog/post/13208/making-plugin-options-pages-compatible-with-wordpress-27/

I’m trying to make it work myself. I’ve never written a plugin before, so we’ll see if I can pull it off.

Scott LindseyFebruary 12th, 2009 at 6:58 am

I believe I have fixed this problem. It’s something that is needed for forward compatibility with regular wordpress, so something like this patch should probably become official.

A patch is available here:
http://www.randomhouse.com/wonderama/wordpress/mu_options.patch

I know that this patch fixes the problem with the main settings panel not working — but that’s all that is fixed. I’m guessing that MU will take further persuading in order to route subdomains to the correct blog. I’m thinking that creative wp-config.php changes will be able to take care of that.

Alex StansfieldFebruary 14th, 2009 at 9:51 am

Hi Scott,

sorry for the late reply. Thanks a lot for this patch. This isn’t a requirement in wp 2.7 yet but will be a requirement at some point so I will make sure I implement it. I’ll be sure to credit you when I do.

Cheers,

Alex

PaulMarch 11th, 2009 at 9:30 pm

Is it possible to, in the instances where subcategories are used, select the outmost category and translate that to the subdomain? Meaning, if in the example above, someone selects “ebook” in the reviews category it would go to “ebook.domain.com” instead of “reviews.domain.com/category/ebook”? The latter throws an error.

PaulMarch 11th, 2009 at 9:41 pm

Ok, i actually had to change the permalink to get that to work. NM.

Alex StansfieldMarch 11th, 2009 at 10:28 pm

Hi Paul,

what was your original permalink and what did you change it to?

The plugin should abide by the permalinks quite well so I’d like to know if there is a problem there.

Cheers,

Alex

PaulMarch 12th, 2009 at 2:21 am

I had it on the default “?p=123″ and clicked on a subcategory and got an error. I’m just getting acquainted to the plugin so it is quite possible that I did something terribly incorrect. I changed it to “/%category%/%postname%” and then it started working. It could of been some caching issues or something. With that said, I’ve blown away the fresh install I was using to test so I cannot reinvestigation.

Alex StansfieldMarch 12th, 2009 at 8:49 am

Interesting. Which version are you using? Version 0.6.0 and above should warn you that you don’t have permalinks set and should not change any of your links to point to subdomains.

Cheers,

Alex

Leave a comment

Your comment