For years I have been developing my own web sites and hosting my own content (text, photos, and videos). I guess I took this approach mainly so I would have full control over everything…us developers can be a little power hungry at times. Sometimes I have different sites (URLs) with specific content for each and sometimes I cram everything together, but before I go into any further details, let’s look at some of the purposes of my site(s).
Types of content I post to the world:
Our current site is back to cramming everything together (read: How We Got Here for more background) though I have not yet really posted any semi-pro photos, nor have I done a whole lot with videos yet. Someday I will take the time to port over the years with of content that I have posted previously.
The one topic (and the point of this post) I have not yet reconciled is where to host the content, specifically photos. Due to the size of videos I am convinced that hosting them on a social network site like YouTube or Vimeo is best…and for me that means Vimeo due to its superior quality (I can post HD videos). In addition, blog content makes sense to keep within your blog software (Blogger, WordPress, etc.) or Content Management System (CMS), again I am using ExpressionEngine for this site. However, those pesky little photos are another story.
Currently I am hosting all of our photos within my own site (ExpressionEngine), again mainly for full control. However, the idea of embedding them in my site from a social network like Flickr does intrigue me a great deal. I hope this post will generate some online discussion with folks like Ken who has tried both ways. Let’s take at my initial attempt at some pros and cons. Hopefully this list will grow as some discussions occur.
Pros of Leveraging a Social Network site (like Flickr):
Cons of Leveraging a Social Network site (like Flickr):
If you have been developing web sites for a while you already undoubtedly know the importance of sitemaps. Most blog software, such as Wordpress, provide plugins to auto generate sitemaps, but I could not find one for ExpressionEngine so I am here to explain how to auto generate your own with ExpressionEngine.
To create a simple sitemap for a SINGLE blog in ExpressionEngine you can follow the instructions explained here. However, our site has multiple blogs so I needed to use a sitemap index, which required a bit more effort. First, I will summarize the steps.
In this step you need to create a template page for each blog. This page generates a sitemap for a particular blog. The code I use is below. Note: You will need to change the two variables to meet your requirements. In addition, you need to change the loc tag to match the URL to your blog.
{assign_variable:master_weblog_name="the_word"}{assign_variable:template_group_name="word"}<?xml version="1.0" encoding="UTF-8"?><urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://ebohling.com/word/</loc>
<lastmod>{exp:stats}{last_entry_date format="%Y-%m-
T;%H:%i:%s%Q"}{/exp:stats}</lastmod>
<changefreq>always</changefreq>
<priority>1.0</priority>
</url>
{exp:weblog:entries weblog="{master_weblog_name}" limit="30" disable="categories|custom_fields|member_data|pagination|trackbacks" rdf="off" dynamic="off" status="Open"}
<url>
<loc>{title_permalink="{template_group_name}"}</loc>
<lastmod>{gmt_edit_date format='%Y-%m-
T;%H:%i:%s%Q'}</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
{/exp:weblog:entries}
{exp:weblog:entries weblog="{master_weblog_name}" offset="30" limit="500" disable="categories|custom_fields|member_data|pagination|trackbacks" rdf="off" dynamic="off" status="Open"}
<url>
<loc>{title_permalink="{template_group_name}"}</loc>
<lastmod>{gmt_edit_date format='%Y-%m-
T;%H:%i:%s%Q'}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
{/exp:weblog:entries}
</urlset>In this step you need to use an FTP client, web administration page, or whatever you do to create files on your web server. In this case, you will need to create some files in your site’s root directory (EE’s installation directory). For me, that is public_html.
You can use whatever naming convention you want, but I chose to use: sitemap-[blog-name].php. So I created three files for my site: sitemap-action.php, sitemap-word.php, sitemap-bryce.php. Each file will contain code that looks like this:
<?php
// Prevent content to be cached
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Content was generated on past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //Content is always modified
// Inform user agent that content is XML and is UTF-8 encoded
header('Content-type: text/xml; charset=UTF-8');
// Read content from template and show it
@readfile ('http://ebohling.com/word/sitemap/');
?>Note: you will need to change the readfile string to match the URL to your sitemap in Step 1.
Again, using the tool you used in Step 2, create a sitemap.php file and use similar code as follows:
<?php
// Prevent content to be cached
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Content was generated on past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //Content is always modified
// Inform user agent that content is XML and is UTF-8 encoded
header('Content-type: text/xml; charset=UTF-8');
echo "<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">";
echo "<sitemap>";
echo "<loc>http://ebohling.com/sitemap-action.php</loc>";
echo "<lastmod>" . date(DATE_ATOM,mktime(0,0,0,10,3,1975)) . "</lastmod>";
echo "</sitemap>";
echo "<sitemap>";
echo "<loc>http://ebohling.com/sitemap-word.php</loc>";
echo "<lastmod>" . date(DATE_ATOM,mktime(0,0,0,10,3,1975)) . "</lastmod>";
echo "</sitemap>";
echo "</sitemapindex>";
?>Make sure you the loc tags to match the URLs to your PHP sitemap files that you created in Step 2.
If you are using an .htaccess file to remove index.php, then you will need to update this file. There are many ways to implement this feature as explained on ExpressionEngine’s wiki, so my sample code may not work for you. But with a little effort, hopefully you will be able to apply the idea to your particular implementation.
RewriteEngine On RewriteCond $1 !^(galleries|css|images|corelib|themes|favicon.ico|robots.txt|index.php|phpinfo.php|sitemap.php|sitemap-word.php|sitemap-action.php) [NC] RewriteRule ^(.*)$ /index.php?/$1 [L]
Note: corelib equates to ExpressionEngine’s core library directory which you should have renamed on installation, so make sure you tweak accordingly. As well as your sitemap names.
First you will need to validate each of your sitemaps. I use the validation tool supplied by XML-Sitemaps. The sitemaps you will need to validate are your sitemap-[blog-name].php (or whatever naming convention you used). So for me: http://ebohling.com/sitemap-action.php, http://ebohling.com/sitemap-bryce.php, and http://ebohling.com/sitemap-word.php. This will not only validate that your sitemap is well-formed, but also that your code in your PHP file and .htaccess file is up to snuff. If you simply want to validate the sitemap you can first validate using your template URL. For me, http://ebohling.com/word/sitemap.
Unfortunately you CANNOT validate the sitemap index (http://ebohling.com/sitemap.php) using this tool. You will need to use Google’s validtor.
As you can see this wasn’t exactly easy. Quite a few steps and a lot can go wrong at each step. Hopefully this will provide you a starting point though and save you some time. Good luck!
Most often I am willing to pay a premium for a product or service that has excellent customer support. This is one (of many) reasons I buy Apple products. On a couple of occasions I have had a small issue with one of their products, I walk into a store, and they have immediately replaced it with a brand new product…it doesn’t get any better than that does it?
For the last several months I have been working on this web site as well as switching hosting providers. As I mentioned in, How We Got Here, I decided to use ExpressionEngine (EE) as the software that runs this site. Yes, there are plenty of free content management systems (CMS) out there and there is even a free version of EE, all which would have been capable of the task. However, I opted to pay the $99 for the personal license of EE.
Why in the world would I pay for something when I could get it for free? Well, I knew as easy as it was to use ExpressionEngine I would have the occasional question that I would rather ask someone about than to take the limited time I had to figure it out myself. This decision has most certainly paid for itself. I have already asked dozens of questions on EE’s support forum and have received prompt responses. Just yesterday one of the EE staff members took time out of his lunch break to log into my site and fix a problem because my hosting provider refused to help.
Which brings me to my rant about poor customer support. First a little background. I have been using WebHost4Life (WH4L) as my provider for years; first for all of my custom .NET web sites and then more recently a second (Linux) account for my PHP-based sites. My Microsoft account has always been top-notch: very little downtime, full control of my domains, and great customer support. However, my Linux account (which I believe they outsource) is absolutely horrible. Hours and hours and hours of downtime and urgent support tickets that go DAYS without being responded to…that is just inexcusable. Hence, the need for change. After reading this blog post and doing some quick research I chose AN Hosting. Granted, I didn’t do my normal, insane amount of research due to the fact that I wanted to get in on the Black Friday deal they had going. While AN Hosting is still light years ahead of WH4L’s Linux hosting, I still have a gripe. On day one of the transition I could not get my .htaccess rewrites to work…nothing complex, simply removing the unnecessary index.php from our URLs, which worked on WH4L. After many days of email exchanges they finally told me that their servers were configured differently than WH4L’s and that they were unable to assist customers with any software issues (including .htaccess). Even after explaining that THEY had the knowledge of their server configs and I did not, so how in the world was I suppose to fix the problem…they essentially said, tough. OK, maybe that is a bit harsh. There was one guy that did expend a BIT of effort, but got me no where. Again, it took someone from ExpressionEngine to say, “hey, I feel for you man…let me help you over my lunch hour”...and blam within minutes my nagging issue was solved.
It just so happens that EllisLab (parent company of EE) provide a hosting service as well, EngineHosting. I did look at it briefly before going with AN Hosting, but I decided NOT to pay the premium for their service…needless to say I won’t make that mistake again. After my contract is up with AN Hosting you can bet that I will be switching to EngineHosting. And why? SUPERIOR CUSTOMER SUPPORT!
Note: In full disclosure the links to WebHost4Life and AN Hosting are linked to my affiliate account as some less demanding people will probably find their services just find and why not get a little something in return? Is that wrong?