WordPress, index.html’s, and 404’s

I came across a WordPress quirk I did not know how to solve for some time. Google Webmaster Tools indicated there was a missing index.html on one of my WordPress driven websites. This website is ran on the root domain and was operating as it should be. When visiting a domain (such as mywebsitename.com) what ever is displayed on the page is what appears in the index.html file. When I entered the address of my website with the index.html file, WordPress gave me a 404 error, and this further confused me.

I did some investigation, and found I was not alone in my frustration, but a solution did not exist. While heading to my root domain worked (mywebsitename.com), mywebsitename.com/index.html did not, even weirder mywebsitename.com/index.php performed the job that index.html should have. To solve this problem, my first instinct was to try a simple redirect index.html to index.php by adding code into my .htaccess file. When I added the following code something interesting happened.

RewriteEngine on
RewriteRule index.html index.php [R=301,L]

This solution produced an infinite loop causing the server to terminate the request. This further perplexed me, I needed a solution without creating another webpage that was also SEO friendly. It wasn’t until I came cross this post, detailing how to redirect index.html and index.php to the home page that I found my answer. While the initial instinct was correct, the way to go about it was all wrong, to properly redirect a request for the index.html to the proper page (and make everyone happy), I had to use the following code:

RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://nexeusfatale.com/$1 [R=301,L]

By setting this condition, I prevented the server loop, redirected the request to the index.html to the root domain, informed search engines to properly update the missing webpage, and made everyone happy!

the next LVL updated to v. 0.9.1

the next LVL has been updated to 0.9.1. today after finding several mistakes and legacy code. I also decided implemented a top-page navigation (was being held for a future release), a future version of the next LVL will allow the toggling of this feature. Visit the the next LVL post for the most recent update.

the next LVL – WordPress Theme

the next LVL is a theme I’ve been developing for a few months and is my first WordPress themes for public consumption. The theme was originally developed to be a CMS based theme, but in it’s evolution became something completely different. The theme is a two column, widget ready theme that is compatible with WordPress 2.7. There are a few elements that make this theme different from others:

  1. the next LVL does not have the traditional website header, that has been shifted onto the right sidebar
  2. Highly SEO friendly without the need for additional plugins
  3. comes with a robots.txt  file to be used in the root directory of a WordPress install
  4. A comical 404 page (feel free to use your own personal message here!)

This theme is the base of a few features I’ve been working on for future themes and future development. They include broader SEO options built into a theme, possible backwards compatibility with older version of WordPress, color changing and graphic changing options.

Currently the next lvl is in version .9.2 (think release candidate), last updated April 8th, 2009.

Recent Changes:

  • version .9.2 (4/8/09)
    - Fixed a font size issue with <select> tags inside of posts
    - Cleaned up CSS Code
    - Removed Plugin Dependend Code
    - Removed Images from Sidebar and replaced with text
  • version .9.1 (4/6/09)
    - Added a page navigation at the top.
    - Updates and removal of legacy code and images
  • version .9
    - Out of alpha development, ready for public beta release.
    - New theme color

Download the current version of the next lvl here

Feel free to leave any feedback in the comments section (including typos and grammatical mistakes, I am notorious for those!)

Enjoy!

WordPress 2.7 Released

wplogo-notext-rgb

WordPress 2.7 has been released! I have been very anxious for it’s release and excited about many of its new features, particularly the ability to update at the click of a button and its new dashboard interface. However there’s a lot more to 2.7.

A feature I am going to enjoy is the new direct integration with plugin’s. In 2.7, searching and installing new plugin’s has been integrated into the Dashboard. In the plugins section, you can click on “Add New” and can install a plugin directory from your hard drive or search for a new plugin and install it directly from the WordPress plugin directory. I wonder if this feature will be coming to themes anytime soon.

For those theme creators (like myself) there are several new features  you should take a look at, mainly sticky posts and new comment handling.

If you have a WordPress install, I highly recommend downloading and integrating into your solution today!

Lightbox: Image Overlay on Webpages

Lightbox is a great image overlay effect that can be used for standalone image effects, galleries. The script fades the site background to and displays the image over the website. Here’s an example below:

Lightbox Demo

The most current version of Lightbox is Lightbox v2.04, but there is a Lightbox 1 which performs a similar task. The differences between the two versions is the use if the Prototype Framework and Scriptaculous Effects Library in version 2.

Using Lightbox

Using Lightbox is really simple but only works with images or text. It relies on the use of the rel tag in the <a> tag. Before using Lightbox, you must install it. To install lightbox (after downloading it and uploading the files to you web server), you must include its three javascript files to your header with the <script> tag.

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>

Next add the Lightbox CSS file by using the <link> tag or merge it with your current CSS file:

<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

After installing and linking the necessary files to the pages you intend to use Lightbox with. This is done by adding the rel=”lightbox” attribute to your <a> tags. You can also use the title attribute to display a caption with your image. Here is how the code for the demo above looks like:

<a href="http://images.nexeusfatale.com/demo/lightbox-demo.jpg" rel="lightbox" title="Lightbox Demo Image"><img src="http://images.nexeusfatale.com/demo/thumb-lightbox-demo.jpg alt="Lightbox Demo" border="0" title="Lightbox Demo Image"/></a>

One option, if you are using a PHP generated page is to create a header file and use include() to have access to lightbox on every page.

Alternative Solutions

Lightbox is a really simple and easy way to add functionality to your designs. There are several alternatives to Lightbox that provide the same or expanded functionality and are more flexible with media (such as Flash objects or more dynamic photo galleries). Thickbox is a jQuery alternative, which works with single images and galleries, as well with AJAX, IFrame and Flash content.

Lightbox in WordPress

For those using WordPress implement Lightbox may present a bit of a challenge. There is however two plugin’s that you can use, the first is Giuseppe Argento’s implantation of Lightbox 2, which is merely a plug-in version of the Lightbox 2 code, I use this plugin on this website. There’s also Rupert Morris’s implementation of Lightbox 2 which is an updated code set that features some automatic features (i.e. automatic lightboxing of images, automatic titling, arrow key implementation) .