Creating Search Engine Friendly URLs With Apache and PHP

Utilizing URLs on your site that are search engine friendly is simple and easy to do thanks to PHP and Apache. We will be utilizing permalinks that get rid of all the nasty $_GET data that trails the end of most PHP scripts. An example of a SEO unfriendly URL we will clean is:

http://www.myguysolutions.com/article.php?id=123&title=seo-php-url

Using a combination of Apache’s ForceType directive, the PHP explode() function and PHP’s PATH_INFO variable we can easily turn the sample URL into:

http://www.myguysolutions.com/article/123/seo-php-url

This not only helps our website’s SEO (search engine optimization), but also accomplishes a security concept is known as “security by obscurity”. By obscuring the fact that our web site is using a PHP script, we may detract potential hackers from looking for exploits within our scripts.

Continue reading Creating Search Engine Friendly URLs With Apache and PHP


Favicon 2.0: Create a Custom Apple iPhone/iPad/iPod Icon For Your Web Site

With the Apple Tablet the iPad arriving it is time to finally learn how to give your web site an icon for Apple touch devices. Have you visited a website on an iPhone or iPod touch and attempted to tap Add to Home Screen only to be disappointed by the results? Years ago the favicon.ico was only found on a few select websites, but today they can be found just about everywhere. The apple-touch-icon rel link attribute has become Favicon 2.0 in today’s web.

This time stay ahead of the curve and learn how to add an icon for your website to an Apple touch device.

By default instead of getting a nice shiny icon, the iPhone will shrink down the homepage of that site and save the capture as the webclip. It is surprisingly simple to create a custom Apple touch icon for your website in two quick steps.

Continue reading Favicon 2.0: Create a Custom Apple iPhone/iPad/iPod Icon For Your Web Site


How To Create a Custom 404 File Not Found Page

One major design element often overlooked by web developers is their 404 File Not Found error page. Most our focus gets lost on CSS and XHTML validation that we often overlook what happens when something goes wrong. Even these pages should be styled with the individual touches of the website. Effective 404 error pages communicate why a particular page couldn’t be displayed and what users can do next.

Who wants their users to see the dreaded default 404 page:

Creating your own custom 404 File Not Found Page can be done in three simple steps by creating or modifying the .htaccess file of the directory and placing a 404.html file in the same directory.

Continue reading How To Create a Custom 404 File Not Found Page


CSS Trick: How To Center an Object/Image Exactly In The Center of Browser

I recently needed to make a landing page using a placeholder image for a site. I wanted their logo image to be vertically and horizontally centered in the browser.

My first thought was to give the image element the class “centered” and then style that class using my CSS stylesheet:

.centered {
position: absolute;
top: 50%;
left: 50%;
}

What that accomplishes is putting the upper left corner of image exactly in the center of the page, not the center of the image in the center of the page.

Continue reading CSS Trick: How To Center an Object/Image Exactly In The Center of Browser