.htacess file tutorial – useful tips

August 12th, 2009

Overview of the “application of principle”

Much of what we find on search engine optimization (SEO) blogs, internet marketing web-inars or your favorite web design news-feeds contain basic strategies to propel your website into the top SERP’s. While this is useful information, sometimes putting these strategies into practice for web designers, internet marketeers, digital strategists or web developers—is very misunderstood, and the ability to put it these strategies into practice, or apply it in a real world situation is lacking.

Much of this APPLICATION of PRINCIPLE—relies on technique, understanding multiple facets of design and development, technical knowledge, past experience (seeing what works and where), trial and error, keeping up with the changing landscape, and many many other factors. The point is that there are “many” and to be able to apply SEO and internet marketing with results—we need to understand strategy and principles as well as being able to apply it. The “apply” is usually taken for granted, and while there are hundreds of thousands out there talking about it, only a few of us know how to apply it with beautiful results!

One small but powerful thing to be aware of is a .htaccess file—here is some basic information

.htaccess (hypertext access) is the default name of a directory-level configuration file that allows for decentralized management of web server configuration. The .htaccess file is placed inside the web tree, and is able to override a subset of the server’s global configuration; the extent of this subset is defined by the web server administrator.

Nowadays .htaccess can override many other configuration settings, mostly related to content control, e.g. content type and character set, CGI handlers, etc.

Below are some basic tips and uses of .htaccess file

1. Create a custom error page.
.htaccess makes it easy to create your own custom error pages. Just create your custom error page files and then add this code to your .htaccess file:
ErrorDocument 401 /401.php  
ErrorDocument 403 /403.php  
ErrorDocument 404 /404.php  
ErrorDocument 500 /500.php
(you should replace the “/500.php” or whatever with your own file path and name.)

2. Prevent directory browsing.
If you don’t include an index file in a directory, visitors can browse the directory itself. But preventing that is as easy as adding a single line to your .htaccess file:
Options All –Indexes

3.Block access to your .htaccess file
By adding he following code to your htaccess file will prevent attempts to access your htaccess file. This extra layer of security protects your htaccess file by displaying a 403 error message on the browser.
# secure htaccess file 
 
Â order allow,deny 
Â deny from all

4. Set the default page of each directory.
If you don’t want to use an index page in each directory, you can set the default page visited when someone reaches (like an about page or a page offering the newest content) that directory by adding this:
DirectoryIndex news.html
(And of course you’d replace the “news.html” bit with whatever you want to use as the default.)

5.Redirect everyone to different site except few IPs
If you want to redirect all the visitors to a different IP. Also give access to certain  few IPs. You can use the code below:
ErrorDocument 403 http://www.youdomain.com 
Order deny,allow 
Deny from all 
Allow from 124.34.48.165 
Allow from 102.54.68.123

6. Redirect Visitors While You Update Your Web Design Site
Update and test your site while visitors are redirected to the page of your choice:
order deny,allow 
deny from all 
allow from 123.123.123.123
ErrorDocument 403 /page.html
allow from all
Replace 123.123.123.123 with your IP address
. Also replace page.html with the name of the page you want visitors to see.

7. Disguise your file types.
You can disguise all of your file types by making them appear as PHP files. Just insert this snippet in:
ForceType application/x-httpd-php

8. Protect your site from hotlinking.
The last thing you want is for those stealing your content to also be able to embed the images hosted on your server in their posts. It takes up your bandwidth and can quickly get expensive. Here’s a way to block hotlinking within htaccess:
view plaincopy to clipboardprint? 
RewriteEngine On  
RewriteCond %{HTTP_REFERER} !^$  
RewriteCond %{HTTP_REFERER} !^http://([ -a-z0-9]  \.)?domain\.com [NC]  
RewriteRule \.(gif|jpe?g|png)$ – [F,NC,L]
(Of course you’ll want to replace the domain\.com with your own domain name.)

9. Restrict file upload limits for PHP:
You can restrict the maximum file size
for uploading in PHP, as well as the maximum execution time. Just add this:

php_value upload_max_filesize 10M  
php_value post_max_size 10M  
php_value max_execution_time 200  
php_value max_input_time 200
Line one specifies the maximum file size for uploading; line two is the maximum size for post data; line three is the maximum time in seconds a script can run before it’s terminated; and line four is the maximum amount of time in seconds a script is allowed to parse input data.

10. Force a file to download with a “Save As” prompt.
If you want to force someone to download a file instead of opening it in their browser, use this code:
AddType application/octet-stream .doc .mov .avi .pdf .xls .mp4

11. Redirect to a secure https connection
If you want to redirect your entire site to a secure https connection, use the following:
view plaincopy to clipboardprint? 
RewriteEngine On  
RewriteCond %{HTTPS} !on  
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

12.Block script execution.
You can stop scripts in certain languages from running with this:
Options –ExecCGI  
AddHandler cgi-script .pl .py .php .jsp. htm .shtml .sh .asp .cgi
Just replace the types of scripts you want to block.

13. Set up a 301 redirect.
If you move around the structure of your site and need to redirect some old URLs to their new locations, the following bit of code will do so for you:
view plaincopy to clipboardprint? 
Redirect 301 /original/filename.html http://domain.com/updated/filename.html

Important Note:

1-Be careful of spelling- .htaccess is not forgiving of spelling errors.
2-htaccess is case sensitive. If something is shown in the examples with a capital letter, make sure it’s capitalized in your htaccess file.

For readers interested in advance knowledge, I will recommend the following guides:
http://www.askapache.com/htaccess/apache-htaccess.html
http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
http://www.noupe.com/php/htaccess-techniques.html
http://www.thomsonchemmanoor.com/16-useful-htaccess-tricks-and-hacks-for-web-developers.html
http://frontdeskapp.com/blog/5-htaccess-tricks-every-webmaster-should-know/

Source: http://www.sem-seo-resources.com/node/63

Share and enjoy this web design link:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • NewsVine
  • Print this article!
  • Reddit
  • StumbleUpon
  • Technorati

Social Media: A duplex channel not one-way marketing

August 4th, 2009

Espresso created a slide deck centering around the Statistics of social media through the last year, some of the stats were very impressive so we listed them below:

Their definition of social media:
Social media is an umbrella term that defines the various activities that integrate technology, social interaction, and the construction of words, pictures, videos and sound—and a fancy way to describe the zillions of conversations people are having online 24/7

3 out of 4 Americans use social technology
Forrester, The growth of social technology Adoption 2008

2/3 of the global internet population visit social networks.
Nielsen, Global Faces & Networked Places 2009

Visiting social sites is now the 4th most popular online activity—ahead of personal email
Nielsen, Global Faces & Networked Places 2009

Time spent on Social networks is growing at 3x the overall internet rate, accounting for – 10% of all internet time
Nielsen, Global Faces & Networked Places 2009

Technology is shifting the power away from the editors, publishers, establishment, the media elite. Now it’s the people who are in control.
Rupert Murdach, Global Media Entrepreneur

13 hours of video is uploaded to YouTube every minute.
412.3 years is the length of time it would take to watch every YouTube video.
100,000,000 YouTube videos viewed per day.

13 million articles available on Wikipedia.

3,600,000,000 photos archived on Flicker.com as of June 2009.

1383% is the monthly grow rate of Twitter users from January to February 2009. The avg number of Tweets per day is 3 million.

5 billion minutes spent per day on FaceBook.
If facebook were a country, it would be the 8TH most populated in the world, just ahead of Japan.

Mark Zuckerberg, 01-07-09

————————————————————-

For companies, resistance to social media is futile. Millions of people are creating content for the social web. Your customers have been there for a long time. If your business isn’t putting itself out there, it ought to be. – BusinessWeek, february 19, 2009

UNFORTUNATELY, MOST COMPANIES ARE TREATING SOCIAL MEDIA LIKE JUST ANOTHER MARKETING CHANNEL.

STOP THINKING “CAMPAIGNS” AND START THINKING CONVERSATIONS. Social media is a duplex channel not one-way marketing

Start out by listening (some tools you can use to listen in)
Google Alerts, Tweetdeck, SocialMentions, RSS
Engage
namechk.com
And Measure
Metrics should map to goals

Share and enjoy this web design link:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • NewsVine
  • Print this article!
  • Reddit
  • StumbleUpon
  • Technorati

Google and Micro-Hoo compete as BING and Yahoo combine

July 31st, 2009

Yahoo and Microsoft’s Bing are set to combine as one powerful search engine.

There are still a lot of questions out there…
Will this partnership create a stronger competitor for Google ?
Well, a 10 year search deal with Microsoft and yahoo is alive now, and it’s said it will better compete with Google, rather than yahoo and Bing as separate entities..

So what exactly is the deal ? It puts Microsoft in control of yahoo search and Yahoo becomes the exclusive search ad provider for Microsoft’s BING. While each company maintains their own separate sales force, and display ad business and Yahoo projects this deal will save yahoo an estimated 200 million dollars, but really puts Microsoft in control.

Last year an agreement between yahoo and Google fell after regulators proposed to block it – so how will this deal fair ?

Impact on SEO and Search marketers ? We will have to wait and see.
What about marketers, advertisers and even consumers ? What will the impact be… we’ll keep an eye out.

Share and enjoy this web design link:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • NewsVine
  • Print this article!
  • Reddit
  • StumbleUpon
  • Technorati

SEO for web designers who use FIREFOX

July 30th, 2009

Below are SEO-related Add-ons for your Firefox browser—that can make your link building and search engine optimization  easier and simpler when searching, browsing and comparing.

SEO Blogger
SEO Blogger allows you to find the most sought-after keywords for your post without ever leaving your blog editing screen.

a4seo
An extension for the webmaster interested in SEO.

RankQuest SEO Toolbar
RankQuest SEO(Search Engine Optimization) Toolbar provides you quick access to more than 30 intuitive SEO tools. Alexa Rank and Page Rank provided by Alexa and Google respectively ensures the popularity of the site.

SEO Workers Analysis Tool
Allows web designers to perform a basic analysis of the page in your browser with a single click. The results from the SEO Workers Analysis Tool are structured into the following useful groups: General status, meta tags

SEO monitor
Information for SEO monitor users displayed in statusbar.

DeeperWeb – Boost and Customize Google Search
Easily navigate through Google search results using a fast, simple and useful Tag-Cloud technique. Use our Topic-Mapping-Technologies for quick access to answers, news, videos, blogs, Wikipedia and more.

Flagfox
Displays a country flag depicting the location of the current website’s server and provides quick access to detailed location and webserver information.

KGen
KGen (Keyword Generator) is an extension that allows you to see what keywords are strong on visited web pages. Than, you can retrieve them for social sharing (tag filling) or webmastering/SEO.

MetaTags
This sidebar displays page meta-information (metatags, links, etc.) Has automated search engine submission menu. Features include: Watches currently loaded Web page and automatically updates the sidebar. Displays metatags, links

SearchStatus
Display the Google PageRank, Alexa rank, Compete ranking and SEOmoz Linkscape mozRank anywhere in your browser, along with fast keyword density analyser, keyword/nofollow highlighting, backward/related links, Alexa info and more.

Google Semantics
This tool helps interactive copywriters to get synonym for the keyword during your search on Google n which helps for better SEO using Google own Synonyms also referred as Latent Semantic Indexing (LSI) n is a vital element in Search Engine Optimization

Niche Watch Tool
SEO extension provides web developers and web designers the technical information required to beat your competitor websites in serps.It gives you backlinks number, indexed pages, keyword occurrences on the page, page rank, all in anchor,

(Advanced) SERPAnalytics Google search
SERPAnalytics is a new seo tool to analyze SERPs. This plugin allows you to search in Google and analyze the obtained results in SERPAnalytics.

SenSEO
SenSEO is an extension checking the most important on-page-SEO-criteria and calculating a grade of how good your site fulfills these criteria.

SeoQuake SEO extension
A Mozilla Firefox SEO extension aimed primarily at helping web masters who deal with search engine optimization(SEO) and internet promotion of web sites. Seoquake allows to obtain and investigate many important SEO parameters of

SEO Toolbar
Displays ILQ and other important SEO numbers.

SEOHAND
SEO services: Track sites placement at Google and Yahoo for any keyword. Watch Google PageRank (PR), Backlinks, Saturation over time. Graph and table presentation of the data.

DigMyLink
Reports the URL, Title, Description and Content of any link as you hover over it. Is supports any page you happen to be on. It does this by reading into the pages info without actually browsing to the actual page with little or no wait

Smart PageRank Toolbar
A small, simple, and powerful. It gives designers quick access to powerful SEO tools. It also includes the Alexa Rank and Page Rank (trademarks of Alexa and Google respectively).

SEO Link Analysis
Enriches the link data in Google Webmaster Tools & Yahoo! Site Explorer by showing the PageRank of the linking page, the anchor text user and whether the link is nofollowed or not.

Seostatus
This extension show Google PR and Yandex TYC in statusbar. Information can be load automaticaly or by click. Also highlight rel=nofollow and noindex tags. Numerating Google search results.

to.ly- URL shortener
URL shortening via to.ly service, one of the shortest URL services available. Shrink any long URL with a single click and use it in blogs, twitter or email. To.ly for Firefox is based on the service to.ly and uses SEO friendly redirects

Highlight My Site
Highlight your favorite sites in Google search results!

StomperTools
Featuring SNRanker, a visualization of Google, Yahoo, and MSN/Live for a specific query term using SVG. See how you rank! Useful for search engine optimization (SEO) assessment as well as exploring a topic.

Knofollo
Knofollo gives the web designer the ability to see “nofollow” attributes in hyperlinks. This is a simple tool with incredible possibilities for the webmaster. Knofollo effectively makes Firefox into a powerful Search Optimization Tool.

Fill Form
Web Directory Form Filler for Firefox – Submit to Directories in Seconds

SEOpen
Provides some basic tools to help with search engine optimization. Including google backlinks, yahoo backlinks, PageRank check, http header viewer, and more. All features are available by right-clicking on an open area of a web page

SEO Toolbar
Displays ILQ and other important SEO numbers.

Foxy SEO Tool
Offers tools for search engine optimization (SEO), web traffic and page analysis for webmasters and web professionals.

Share and enjoy this web design link:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • NewsVine
  • Print this article!
  • Reddit
  • StumbleUpon
  • Technorati