-
Posts Tagged ‘Web Development’
Knowledge Nuggets
Friday, January 20th, 2012 by Christian MattixAnyone who has done development, design, or IT knows that over the course of working on a project, you collect various “nuggets” of knowledge that you ever learn or find. Here I’m going to share some of what I’ve discovered that may be able to help you in your own projects. I have cited the original source of the information if I have that available. If there is something that I’ve left out, feel free to add it in the comments.
“Fatal error: Out of memory…” occurring when PHP and Apache memory limits seem fine
This problem drove me crazy for a little while. I did everything that I thought I needed to do, I changed the php.ini file to increase the php memory available until I ran across this link which provided the answer. We are using WiredTree as our hosting provider, for their servers, the problem was fixed by simply adding:
RLimitMem 128000000to the .htaccess file in the www root directory. After doing this, it fixed everything.I keep getting Notice: Undefined offset: 1 in views_block_view() in Drupal 7
After doing a bunch of operations during prototyping a Drupal 7 site we kept this error. There wasn’t anything that we seemed to be able to do to eliminate it from the Drupal administrative interface. After searching the web for quite some time I came across this page: http://objitsu.com/node/29 which gave me all of the information I need. From the article:
It’s caused by stale records in the block table that then fail to resolve. There’s plenty of reading material out there and suggested fixes etc. that I am sure work but once I knew what the problem was I applied *my process* for all Drupal problems like this.
- Find the code that issues the message..
- Trap the code and drupal_set_message() the offending item
- Use that information to fix-up the database / code as required.
Here’s how the fix works for this particular problem. In my case I edited views.module, line 569, here’s the code that was causing the notice to be show:
list($name, $display_id) = explode('-', $delta);
and here is what I added to the code to find out what the duff delta in question was…
if (count(explode('-',$delta)) == 1) { drupal_set_message($delta); } list($name, $display_id) = explode('-', $delta);
All I did then was refresh the page, take a note of hash value that was displayed and then cutting-and-pasting it into a command line MySQL session I issued this query:
mysql> DELETE FROM block WHERE delta = 'd98a0bfa5a33e7d8bab0fc0670bdc9fd'; Query OK, 4 ROWS affected (0.01 sec)
Which took out all four problem pages at once.
What are the command line commands for git?
We use git for source control of our iOS projects. I found a great cheat sheet of git commands here:
Git Cheat Sheet.Who’s Your Audience and What’s Their Word?
Thursday, April 14th, 2011 by Butch WhitmireThe latest data from Experian Hitwise shows that the number of keywords typed into search engines is declining. Longer searches, those of 5-8 words, were down last month 3%. As the data table shows, 1 word searches comprise a full 24% of all searches. 2 word searches are a close second.

When it comes to people finding your business or organization organically on the web, understanding who your potential customers are, how they think, and what they may type into their favorite search engine is essential.
At Force 5, we help clients determine their customer’s “word” as part of our Soul Searching™ brand development process and in our free SEO consultation services included in their web development packages.
How-To: Use Wget to Automate the Karamasoft UltimateSearch Indexing Process for Your Website
Wednesday, January 5th, 2011 by Christian MattixAlmost every modern website has a “search my site” module of some sort added to it. In this How-To I’m going to explain how to set up Karamasoft UltimateSearch to automatically rebuild its index on a repeating scheduled basis in a Microsoft Windows hosted environment.
First, you will need to obtain the UltimateSearch software from the Karamasoft site, found at: http://www.karamasoft.com/UltimateSearch/Features.aspx. Follow the directions provided to get the tool installed into your particular hosting environment. For this How-To I’m going to assume that you have a website www.example.com that you have the tool installed in. The process for starting the indexing process is as simple as accessing a particular webpage on your site and passing it a particular operation code in the query string. To start the full indexing process for our example site you would navigate to:
http://www.example.com/UltimateSearchInclude/Admin/UltimateSearch.admin.aspx?cmd=IndexFull
We want to be able to call this process via a script, so we will need something lightweight and easily used from within a scripting language. A perfect tool for this is the Open Source GNU Wget utility. From the GNU Wget site:
GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.
Download and install the GNU Wget utility. The Windows port can be downloaded from http://gnuwin32.sourceforge.net/packages/wget.htm. Download the setup program, follow the setup wizard, and install the utility to your server. After the installation process has completed, add the directory that you installed wget.exe into to the PATH environment variable.
Once you have UltimateSearch and Wget installed on your server you are now ready to set up the indexing job. In order to have the site be indexed based on a schedule, the admin link needs to be visited on a scheduled basis. In order to do this, we are going to use the Wget utility that we just downloaded in a batch file. That batch file will then be called as a scheduled task by Windows.
The batch file that I created is named
USearchIndexTask.bat. In it is the following:@echo off wget -O - http://www.example.com/UltimateSearchInclude/Admin/UltimageSearch.admin.aspx?cmd=IndexIncremental > nul 2> nul
I have saved this file in
c:\Program Files\Force5\USearchIndexTask.bat. You can save it where-ever it makes the most sense in your hosting environment.Once the batch file is saved, then you need to create a scheduled task to run the batch file. In our environment I used Windows Task Scheduler to create the task. Use that tool to create a task to run the
USearchIndexTask.batfile. Choose a frequency that makes sense for your environment, based on the quantity of changes for the site. If there are very few changes made on a daily bases, then having it run once a day at midnight is an appropriate setting.Manually run the scheduled task to verify that it completed successfully, and then go get lunch. You are done!
To see more bright ideas from the Left and Right brains of Force5, check out the rest of our blog as well as our work!
Prevent Duplicate Content
Thursday, December 9th, 2010 by Force 5Having duplicated content within search engines is a very common problem that is often overlooked. You would think having duplicated content will be good for your search rankings, although that is not the case as it may be not useful to the end-user.
www-vs-non-www (Problem)
Search engines recognize your
www.your-domain.comandyour-domain.comas two separate websites. You may not be penalized by having multiple results although you can improve the efficiency for end-users combing through the search results. In addition, if you have a single convention of your domain usage people linking to your site can improve your link backs.www-vs-non-www (Solution)
Since search engines track these as separate sites you need to pick either your
wwwdomain or thenon-wwwdomain. You still want both versions active although what you want to do is to create a 301 Permanent Redirect to your desired domain. For example,http://discoverforce5.comwill redirect your browser tohttp://www.discoverforce5.com. By performing a 301 Permanent Redirect you are telling search engines not to store/index the redirected content for that page/location.One thing to not forget is that you make sure you allow your website URL paths to be included during the 301 Permanent Redirect process. For example,
http://discoverforce5.com/Media-Hub/will send the end-user tohttp://www.discoverforce5.com/Media-Hub/. As you see it makes sure to send the end-user to their original desired page.ASP.NET Code Example:
In this example we want to use the www domain as the main convention and redirect the non-www domain. The code below you see we grab the current domain and the URL path the request was made. We then check to see if the domain includes the www, if not, we perform the 301 Permanent Redirect.
// get server name/domain string sDomain = Request.Url.Host.ToString().ToLower(); // i.e. discoverforce5.com // get url path string sPath = Request.RawUrl.ToString(); // check if www is in the server name if (!sDomain.Contains("www.")) { // server name does not contain www - proceed with 301 Permanent Redirect Response.RedirectPermanent("http://www." + sDomain + sPath); }
Apache Server Example:
With Apache servers this process is easier with utilizing the
.htaccessfunctionality. Below you will see the Apache server equivalent to the ASP.NET example above.RewriteEngine On RewriteCond %{HTTP_HOST} ^discoverforce5\.com$ [NC] RewriteRule ^(.*)$ http://www.discoverforce5.com/$1 [R=301]Inconsistent Linking
Try to keep internal and external page links to your content consistent. For example, don’t link to
http://www.discoverforce5.com/Services/andhttp://www.discoverforce5.com/Servicesandhttp://www.discoverforce5.com/Services/Default.aspxas all three examples are different.If you are interested in learning about how to submit your site to search engines feel free to read “The little things to not forget about during development [Part: 2]“.
Have any SEO needs or questions? Please give Force 5 a call.
Pin sites to your taskbar
Monday, October 18th, 2010 by Force 5
With the recent release of Microsoft Internet Explorer 9 beta you are now able to see the work that has gone into a browser that has not seen much forward development in meeting web standards or rendering speeds compared to its rivals (Opera, Firefox, & Google Chrome). Microsoft has even launched BeautyOfTheWeb.com website showcasing the new features and abilities.One of the new features that I believe will be really useful for some users is pinning the website to the Windows taskbar. By pinning the website to the taskbar the end-user will have the ability to go to a site quickly without having to open up the web browser and finding the link in favorites/bookmarks area. One of the better examples where this feature can excel at is from USA Today. By pinning this site you are able to get quick links to all the different news sections (news, money, sports, life, & tech).
What do I need to do to add it?
The only basic prerequisite is that your website should have a favicon. That way aesthetically your pinned site will be branded appropriately. Code wise you will need to add at minimum two
<meta>elements inside of the<head>section of your web page.First, add your
application-name. For example, we’ll enter “Force 5” into thecontentattribute.<meta name="application-name" content="Force 5"/>
Second, add an
msapplication-task. Thecontentattribute is broken up into a couple sections. Thenameparameter is the label you want to appear; in this case we will enter “Discover Force 5“. Theaction-uriparameter is where we want to send the end-user; in this case we will enter “http://www.discoverforce5.com/”. The next step is optional; you can enter your favicon to theicon-uriparameter. Lastly, just repeat these steps to add more “tasks”.-
<meta name="msapplication-task" content="name=Discover Force 5; action-uri=http://www.discoverforce5.com/; icon-uri=http://www.discoverforce5.com/favicon.ico"/>
Example with multiple tasks:
<meta name="application-name" content="Force 5"/> <meta name="msapplication-task" content="name=Discover Force 5; action-uri=http://www.discoverforce5.com/; icon-uri=http://www.discoverforce5.com/favicon.ico"/> <meta name="msapplication-task" content="name=Media Hub; action-uri=http://www.discoverforce5.com/Media-Hub/; icon-uri=http://www.discoverforce5.com/favicon.ico"/> <meta name="msapplication-task" content="name=Employee Blogs; action-uri=http://www.force5blog.com/; icon-uri=http://www.force5blog.com/favicon.ico"/>Next: pin your site
After saving your changes, go to your web page with the new code above.
- Grab your favicon by dragging it to the taskbar.

- Pin favicon to your taskbar.

- Site is successfully pinned!

- Click on your new pinned task icon and go some where.

Even though IE9 is still in beta it is good to see Microsoft bringing new features to the table. If you feel like trying out IE9 today, click here.
How-to: 301 Permanent Redirect with ASP.NET 4 – Response.RedirectPermanent()
Friday, July 9th, 2010 by Force 5During the process of migrating development over to the .NET 4 Framework there have been noticeable improvements.
One of the newest improvements is used quite often, Response.RedirectPermanent(). This new feature does a permanent redirection from a requested URL to a specified URL.
For a quick flashback to how this was previously completed review the code below:
/* * Previous 301 Permanent Redirect * */ Response.Status = "301 Moved Permanently"; Response.AddHeader("Location", "NewPage.aspx");
How you implement the new 301 Permanent Redirect is simply Response.RedirectPermanent(“URL-path-goes-here”). Here is an example with the new way with fewer lines of code.
/* * .NET 4 301 Permanent Redirect * */ Response.RedirectPermanent("NewPage.aspx");
By implementing 301 redirects it is a good practice to inform search engines that content has moved to a new location. Here are examples where Force 5 is involved with 301 redirects:
- a web page that have moved
- a web page that has been removed
- web page content that has been consolidated with another web page
- non-www permanent redirect to the www (or vice versa)
- example: http://discoverforce5.com gets 301 redirected to http://www.discoverforce5.com.
How-to: Adding META Keywords & META Description with ASP.NET 4
Tuesday, July 6th, 2010 by Force 5In a previous post I showed how-to add specific page keywords & descriptions while using ASP.NET with Master Pages. Compared with the latest ASP.NET 4 version, this technique was not coder friendly.
In ASP.NET 4 adding page keywords and descriptions is as easy as this shown below.
protected void Page_Load(object sender, EventArgs e) { // page keywords Page.MetaKeywords = "keywords go here..."; // page description Page.MetaDescription = "description go here..."; }
Overall, page keywords & descriptions are still important for SEO success along with page titles and page content. If you need any help with your website search rankings please feel free to contact Force 5 for some guidance.
Is Your Website Customer-Centric?
Friday, May 21st, 2010 by Force 5In case you haven’t noticed the web is changing. There is a huge movement underway toward clean, simple, user friendly websites that promote productivity and, consumer interaction. The average consumer doesn’t care how creative a design team you have or, how technically advanced your development team is. They want information. Honest, peer driven information.
Whether a potential customer is at your site to buy a product, comment on your organization, read reviews, download a podcast or, read your latest blog entry, it’s your job to keep them interested and coming back. This is what customer-centric website design is all about.
So what is a customer-centric website?
Simple. A customer-centric website focuses on your customers and what they want. Today’s online consumer is not interested in your company, products or services – they are interested in themselves. A customer-centric websites is structured so the customer can easily find what they want or get answers to their questions. By focusing your website on customer benefits and, ensuring a unique user experience, you will not only increase loyalty you’ll generate the much coveted word-of-mouth advertising; both key drivers of online sales.
There are a few basic steps you can take to get started on the road to a customer-centric website
• Clearly define your product or service and how customers will benefit from it
• Make sure your contact information is never more than a click away
• Clearly organized and easily navigable site content
• Place links in consistent locations and include them on every page
• Review your content for spelling and grammar mistakes
• Allow customer feedback on products, services and the site
• Make it easy for customers to get what they want
• Ask customers for a bare minimum of information to register or sign up
• Include in-depth, well written FAQ’s
• Make it easy for a customer to get supportA successful customer-centric website is created by meeting customers’ needs better than anyone else. If you focus every aspect of your website on meeting your customers’ needs you’re much more likely to remain a preferred provider. Remember, your customer is your best source of advertising. Give them what they want and they will tell the world.
Don’t get left behind. Take the next step toward a true customer-centric website. Contact Force 5 today at 574-234-2060 or info@discoverforce5.com.
The little things to not forget about during development [Part: 2]
Friday, May 7th, 2010 by Force 5Sitemap.xml
What are Sitemaps and why are they important?
Sitemaps are a tool for developers to inform search engines about the website content that is available to be indexed. The sitemap protocol is made up of XML that contains a list of URLs, last modified dates, and page priorities for your website.
Here is a quick sample in simple form of a sitemap.xml file:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9”> <url> <loc>http://www.discoverforce5.com/</loc> </url> <url> <loc>http://www.discoverforce5.com/About/</loc> </url> </urlset>
For more information on sitemap protocol and XML tag definitions visit: http://www.sitemaps.org/protocol.php#xmlTagDefinitions
Below you will see two optional attributes available to include in your sitemap. The new attributes you see will be <changefreq> and <priority>. As stated within the sitemap documentation:
- <changefreq> refers to how often a page is likely to change even though search engines may not crawl that often.
- <priority> refers to the priority related to other links/URL’s within your site.
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9”> <url> <loc>http://www.discoverforce5.com/</loc> <changefreq>monthly</changefreq> <priority>1.00</priority> </url> <url> <loc>http://www.discoverforce5.com/About/</loc> <changefreq>monthly</changefreq> <priority>0.80</priority> </url> </urlset>
For more information about sitemaps and more advance information head over to www.sitemaps.org.
Next steps – Submitting your sitemap to the search engines
Each search engine is different in how they approach webmasters in submitting sites. Here is a list of locations to submit your sitemap.xml to search engines:
- Google: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156184
- Yahoo: http://search.yahoo.com/info/submit.html
- Bing: http://www.bing.com/toolbox/posts/archive/2009/10/09/submit-a-sitemap-to-bing.aspx
Tying in both the sitemap.xml with robots.txt
In part 1 of this series discussing robots.txt, you can declare the location of your sitemap.xml file for web crawlers/bots. Here is an example what a Robots.txt would look like:
User-agent: * Allow: / Sitemap: http://www.yourdomain.com/sitemap.xml
A quick refresher about the syntax above: “User-agent: *” is defining all bots and “Allow: /” is stating index all folders.
If you have multiple sitemaps you can declare them in your Robots.txt file. Here is an example in how to do so:
User-agent: * Allow: / Sitemap: http://www.yourdomain.com/sitemap-1.xml Sitemap: http://www.yourdomain.com/sitemap-2.xml
In conclusion, having a sitemap.xml is not required for successful search engine indexing. Although, at Force 5 we believe it is beneficial when submitting your site to search engines that your site will be properly indexed. A great example is when a new site is going live where older pages may no longer exist in the same location. Even though search engines use other methods on indexing your site, using Sitemaps will in the end help the indexing process.
If you have any SEO needs or questions please give Force 5 a call.