Increase PHP’s File Upload Settings with .htaccess

From time to time the need comes up to increase the maximum file upload size for a website. For reference, what I’m referring to is uploading media files (pictures, PDFs, data files, etc.) through an HTML web form.

Typically PHP comes configured to allow a 2 Meg upload size. Some web hosting companies allow you to make these changes directly in the PHP.ini file. In that case you open your PHP.ini file and simply look for “upload_max_filesize”, “post_max_size”, and “memory_limit” and make the appropriate changes.

If no PHP.ini file is available through your hosting platform an alternative method for adjusting this would be to add the following three lines to your .htaccess file.

php_value  upload_max_filesize  8M
php_value  post_max_size  16M
php_value  memory_limit  24M 

Some notes:

Keep in mind that extra large files will take longer to upload so you’ll want to make sure that your scripts do not time out when uploading. This will be a trial-and-error process based most likely on your client’s Internet connection speeds.

SEO Audit Outline

[quotes_right]
REFERENCE: 

How to Perform the World’s Greatest SEO Audit by Steve Webb, Ph.D.

… Thanks, Steve, for the good reference.
[/quotes_right]

This article was posted on SEOMoz recently and I thought that it would make a great resource to have on-hand for reference when reviewing a website for SEO quality. The article is written by Steve Webb (see article references on this page) and I have captured the outline here for my reference. Visit the article for all of the full details.

SEO Audit Preparation

  • Crawl Before You Walk
  • Crawling Tools
  • Crawling Configuration
  • Ask the Oracles

SEO Audit Analysis

  • Accessibility
    • Robots.txt
    • Robots Meta Tags
    • HTTP Status Codes
    • XML Sitemap
    • Site Architecture
    • Flash and JavaScript Navigation
    • Site Performance
  • Indexability
    • Site: Command
    • Index Sanity Checks
    • Page Searches
    • Brand Searches
    • Search Engine Penalties
    • Make Sure You’ve Actually Been Penalized
    • Identify the Reason(s) for the Penalty
    • Fix the Site’s Penalized Behavior
    • Request Reconsideration
  • On-Page Ranking Factors
    • URLs
    • URL-based Duplicate Content
    • Content
    • Information Architecture
    • Keyword Cannibalism
    • Duplicate Content
    • HTML Markup
    • Titles
    • Meta Descriptions
    • Other <head> Tags
    • Images
    • Outlinks
    • Other <body> Tags
  • Off-Page Ranking Factors
    • Popularity
    • Trustworthiness
    • Backlink Profile
    • Authority
    • Social Engagement
    • Competitive Analysis

SEO Audit Report

  • Write for multiple audiences
  • Prioritize, prioritize, and then prioritize some more
  • Provide actionable suggestions


URL Trailing Slashes and Canonical URLs

I noticed recently in my Google Webmaster Tools account that Google seems to be honing in on house cleaning for webmasters. Maybe it’s the recent Google updates that have come down the pike in the past twelve months and maybe it’s just my imagination but nonetheless it’s a good habit for webmasters to practice.

The one thing that lead my suspicion of this was the notes on a few of my sites that Google has begun to put into “HTML Improvements area is alerts over trailing slashes in the URL string. For reference, the following URLs are not the same to a search engine:

  1. http://www.mysite.com/page-name
  2. http://www.mysite.com/page-name/
  3. http://www.mysite.com/page-name/index.html

Because I generally don’t link to any index.html files directly inside of directories, the first two in the list were of particular concern to me and not the third.

The solution is to put the following three lines into your .htaccess file:

RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.mysite.com/$1/ [R=301,L]

That will automatically enter the trailing slash to the url if it is not already present. Remember to keep those three lines together in the .htaccess file.

Adding a Site-Map Page in LightCMS

I have not found functionality to-date in LightCMS where a site map can be printed to the main content area of a page. Most site maps that are developed for people to read (as opposed to XML maps that are designed for search spiders) simply print an unordered list to the body are of a page and then link to it within the site’s footer area.

The easiest method for accomplishing this in LightCMS that have found is to:

1) Create a new template (call it “Site-Map.html”) and template icon (call it “Site-Map.html.gif”).

2) Add the standard “main region” token to this in case you want to add a little content to the page. (If you are copying an existing template like your “Inside.html” template you might already have this tag in your file.)

<$region name="main"$><$/region$>

3) Below that token in the template code add the following global menu token:

<$globalmenu cssClass="site-map" alwaysShowChildren="true" /$>

4) Upload those to your two files to your server through FTP or the LightCMS file manager.

5) Create a page called “Site Map” in LightCMS’s content management system and assign that new template to it.

Websafe Fonts and Other Options

[quotes_right]

  • Arial, Helvetica, sans-serif;
  • ‘Arial Black’, Gadget, sans-serif;
  • ‘Bookman Old Style’, serif;
  • ‘Comic Sans MS’, cursive;
  • Courier, monospace;
  • ‘Courier New’, Courier, monospace;
  • Garamond, serif;
  • Georgia, serif;
  • Impact, Charcoal, sans-serif;
  • ‘Lucida Console’, Monaco, monospace;
  • ‘Lucida Sans Unicode’, ‘Lucida Grande’, sans-serif;
  • ‘MS Sans Serif’, Geneva, sans-serif;
  • ‘MS Serif’, ‘New York’, sans-serif;
  • ‘Palatino Linotype’, ‘Book Antiqua’, Palatino, serif;
  • Symbol, sans-serif;
  • Tahoma, Geneva, sans-serif;
  • ‘Times New Roman’, Times, serif;
  • ‘Trebuchet MS’, Helvetica, sans-serif;
  • Verdana, Geneva, sans-serif;
  • Webdings, sans-serif;
  • Wingdings, ‘Zapf Dingbats’, sans-serif;

[/quotes_right]

Websafe Fonts

If you don’t use an HTML editor that readily reminds you of all available websafe fonts it can be hard to remember those. Here is a list of several sites that have some good reference info on this.

www.ampsoft.net/webdesign-l/WindowsMacFonts.html
www.w3schools.com/cssref/css_websafe_fonts.asp
www.fonttester.com/help/list_of_web_safe_fonts.html
web.mit.edu/jmorzins/www/fonts.html

Font Hosting Sites

Another thing to note is that if you need something a little more specific than the typical websafe font and don’t want to embed it all in a graphic, there are several font services — some free and some paid — that will serve the fonts to your website on demand.

Essentailly, all you do is put a link tag in the header of each page on which you use the font (<link href=”” />) and pull in the font as people visit your pages. Then you just call out the font in your CSS class (in your style sheet, within the <style></style> tags on your page, or inside of the style=”” attributes) like you normally would. Here are some places to find these.

Google.com/webfonts (www.google.com/webfonts)
Fonts.com (new.fonts.com/)
TypeKit.com (typekit.com/)

HTML Conditional Statements (IF IE)

IF conditions are allowed in HTML and can be a very powerful way to quickly eliminate cross-browser issues. The IF IE set of conditionals is great to have on hand and can save hours of frustration when trying to wrap up projects quickly.

Here they are:

<p class="accent">
<!--[if IE]>
According to the conditional comment this is IE<br />
<![endif]-->
<!--[if IE 6]>
According to the conditional comment this is IE 6<br />
<![endif]-->
<!--[if IE 7]>
According to the conditional comment this is IE 7<br />
<![endif]-->
<!--[if IE 8]>
According to the conditional comment this is IE 8<br />
<![endif]-->
<!--[if IE 9]>
According to the conditional comment this is IE 9<br />
<![endif]-->
<!--[if gte IE 8]>
According to the conditional comment this is IE 8 or higher<br />
<![endif]-->
<!--[if lt IE 9]>
According to the conditional comment this is IE lower than 9<br />
<![endif]-->
<!--[if lte IE 7]>
According to the conditional comment this is IE lower or equal to 7<br />
<![endif]-->
<!--[if gt IE 6]>
According to the conditional comment this is IE greater than 6<br />
<![endif]-->
<!--[if !IE]> -->
According to the conditional comment this is not IE<br />
<!-- <![endif]-->
</p>

Note that they are only allowed in HTML and not in CSS. IF you want to load a whole separate CSS file for IE for one reason or another you can put the link tag into the conditional as follows:

<html>
  <head>
    <title></title>

    <!--[if IE]>
      	<link rel='stylesheet' href='stylesheet.css' type='text/css' />
    <![endif]-->

  </head>
  <body> ... 

[quotes]Reference:

  1. quirksmode.org/css/condcom.html
  2. css-tricks.com/how-to-create-an-ie-only-stylesheet/

[/quotes]

Custom Title Tags for OpenCart

If you are concerned at all about SEO you won’t use OpenCart long before realizing that the out-of-the-box OpenCart software does not allow you to write page title tags that are different from the actual titles of your products. In the stock-version these two items are one and the same making it impossible to write custom title tags that look good in the search engines but don’t mess up the look and feel of your website.

The solution is actually very simple — and actually very FREE.

Just below the Meta Description field in the product admin area is the field for Meta Keywords. This tag has long been abandoned by the search engines so rendering it useless to us, until now.

Use that field in the admin area to enter all of your unique page title tags and then just do a slight modification to the header template and voila, custom title tags for OpenCart!

Here’s the code:

Edit is file: "/catalog/view/theme/YOURTHEME/template/common/header.tpl"

Replace this:

<?php echo $title; ?>

With this:

<?php if ($keywords) { echo $keywords; } else { echo $title; } ?>

Then, simply delete the useless meta keyword tag to keep things clean in the code.