Category Archives: SEO

Allowing or Blocking based on Country with .htaccess

Examples
Redirection with mod_geoip and mod_rewrite
Below are examples of how to perform redirection based on country with mod_geoip and mod_rewrite. This configuration should be added to your Apache httpd.conf or .htaccess file.

GeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat

# Redirect one country
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$
RewriteRule ^(.*)$ http://www.canada.com$1 [L]

# Redirect multiple countries to a single page
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CA|US|MX)$
RewriteRule ^(.*)$ http://www.northamerica.com$1 [L]

List of .htaccess Examples

From the .htaccess cheatsheet

The Camping Server for Apache + FastCGI

FastCGI .htaccess

This is a basic FastCGI .htaccess file. The last line is the most important.

AddHandler fastcgi-script .fcgi 

Options +FollowSymLinks +ExecCGI  

RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi/$1 [QSA,L]

W3C Talks and Presentations

Developing Joint Test Suites [PRES-JOINT-TS] (2 March 2005), Patrick Curran As part of a session in the Technical Plenary day, the QA Working Group presented its view on developing test suites for multiple specifications
QA Framework presentation to the Voice Browser Working Group [PRES-VB-WG] (15 February 2005), Dominique Hazaël-Massieux Brief introduction of the QA Framework and [...]

Nice .htaccess keywords

Wordtracker helps website owners and search engine marketers identify keywords and phrases that are relevant to their or their client’s business and most likely to be used as queries by search engine visitors.
Marketers can also determine how many competing sites are using those keywords and can identify the phrases that have the greatest traffic potential.
Wordtracker [...]

Bash, a Linux Shell as an IDE

Turn Vim into a bash IDE
By Joe ‘Zonker’ Brockmeier on June 11, 2007 (9:01:00 PM)

By itself, Vim is one of the best editors for shell scripting. With a little tweaking, however, you can turn Vim into a full-fledged IDE for writing scripts. You could do it yourself, or you can just install Fritz Mehner’s [...]

GDB Debugging Documentation

GDB Documentation

Printed Manuals
The GNU Press has printed versions of most manuals, including Debugging with GDB available.
Online GDB manuals
Documentation generated from the current sources are available online:

GDB User Manual (gziped PDF)
Describes how to use GDB.
Translations are also available:

Japanese, by Kazuhisa Ichikawa as part of KI’s Unofficial GNU Manual Translation Project.
Russian, by Dmitry Sivachenko.

GDB Internals Manual [...]

What is GNU?

What is GNU?
The GNU Project was launched in 1984 to develop a complete Unix-like operating system which is free software: the GNU system.
GNU’s kernel wasn’t finished, so GNU is used with the kernel Linux. The combination of GNU and Linux is the GNU/Linux operating system, now used by millions. (Sometimes this combination is incorrectly [...]

htaccess magic

.htaccess Magic!

By Katherine Nolan
Expert Author
Article Date: 2003-04-16
If your site is hosted on a Unix or Linux server which runs Apache, you may already be familiar with your .htaccess file.
We referred to it in an earlier tutorial on Creating Custom Error Messages, where we showed how you can configure it to instruct [...]

Using .htaccess Redirects for Affiliate Links

.htaccess redirect
Editing the .htaccess file can make your website inaccessible if done incorrectly. Always make sure you have a back-up of the current version of the .htaccess file, to go back to a working version.
.htaccess is a file on Apache servers. It’s a very powerful tool, but often requires rather detailed technical knowledge to edit. [...]