Tag Archives: hosting

Use symlinks to serve subdomain content

When you add a subdomain to your site, many hosting providers will automatically create a new physical folder on the server to match the subdomain name and to serve the subdomain content from. Which is all fine and good if your subdomain has a completely different content from main site/other subdomains.

But there’re situations when you need several subdomains to point to the same physical folder. Case in point: WordPress multisite install. There’s only a single installation of WordPress software, but depending on how you access it – it will serve different content. For example if you visit http://kitchen.galanter.net you will see a culinary blog, but if you open http://codecorner.galanter.net – a programming content will be served to you. This is achieved by WordPress by reading host header information (HTTP_HOST) and depending on header name (“kitchen” or “codecorner”) different content will be served. But it will be served from the same physical folder

Many hosting providers allow you to select root folder for the subdomains – in this case it’s easy: just add subdomain, point it to the root folder of the main domain and you’re done. But some, like my current host hard-code subdomain-subfolder relationship and it’s not allowed to change. In my case my root domain (which serves http://www.galanter.net) is physically located in /galanter.net/public folder. When I added subdomain codecorner, provider automatically created folder /galanter.net/codecorner/public which would have a completely different content, but I needed its content to be served from main /galanter.net/public folder, just pass “codecorner” HTTP host header to it. Enter symlinks. Continue reading →

Changing hosting. Again

Two years ago I switched to BlueHost. For a while it’s been a beautiful run, but lately the service has become horrible. Constant downtimes, and when sites were up they we unbelievable slow. So after a couple of MySQL DBs export/imports, after moving DNS hosting to my registrar GKG.NET – it’s:

Goodbye BlueHost, Hello Feral Hosting.

WordPress MU: Delete Empty Posts

Sometimes I bring information to a couple of my other WordPress blogs via RSS feed. It’s a nice feature, allowing you to create several posts at once without manual entry. Unfortunately if RSS feed is broken or improperly formatted it can result in blank posts imported into the blog.

I was looking for a WordPress plugin that would allow me to mass-delete empty posts, but apparently none exist. You can delete posts based on date, tags, category, but not the content. Fortunately if you have access to phpMyAdmin of your MySQL installation – there is a solution. Continue reading →