Apache’s mod_alias — simple redirects

If you have long nasty URLs on your site and you wish to shorten them or make them more friendly to users or search engines — one solution can be found using Apache’s mod_alias.

In order to use this solution you will need to have rights to edit Apache’s conf files or just the conf file for your virtual host.

The basic format is:

Redirect <status> <old URL> <new URL>

Status is optional. The default value is 302.

Status Description
301 Permanent This tells the browser and search engine to permanently disregard the old URL and only pay attention to the new URL. Use this when you are permanently moving content off-domain or restructuring your on-domain page tree.
302 Temporary Use temporary redirects when you want to clean up on-domain links. Search engines will continue to index the old URL but browsers will redirect to the new URL. For example use a 302 status to redirect team.league.com to city.team.league.com/display.php?team=123.
303 See other This status code is useful to prevent duplicate form submissions.
401 Gone This is telling the browser that the page is gone forever. In this case do not supply a URL to redirect to.

Examples:
Redirect all requests to a new domain

Redirect 301 / http://www.newdomain.com/

Permanently redirect an on-domain path to a new on-domain path

Redirect 301 /old/foo /new/foo

Temporarily redirect a path off domain. (Search engines will treat this as a 301)

Redirect /foo http://www.offdomain.com/foo

Indicate that the given page is gone forever.

Redirect 401 /dead/page.html

image licensed under creative commons

Tags: ,

Wordpress – how to change “read more” text

Wordpress has a very handy tool that they call a “more tag” that allows you to indicate exactly where an article should be cut off with a link to a page showing the single article in its full form.  The shortened “teaser” version will appear everywhere except when the user is viewing the article by itself.

This is a very basic feature that every blog system should have but that doesn’t make it any less powerful.

However – the actual anchor text that gets displayed (for example “Read more…”)  is defined in the Wordpress theme you are using. Check you theme — some themes give you an interface to customize the continue anchor text.

This article just describes how to change the default “read more” text. If you have more complex needs you can do a Wordpress plugin search on “read more” and you’ll find some plugins that might work for you.

If you are using the standard Wordpress post editor to add a break you click on the “insert more tag” button – which is pictured in the upper left of this article.  What this actually does is insert a tiny bit of HTML into your article:

<!-- more -->

For those of you not familiar with HTML – Continue reading »

Tags: , , , ,

Quick and easy Drupal install on Ubuntu

Drupal calls itself a hybrid content management system and content management framework.  I think a better description is website in a box.  If you have not looked into this very powerful LAMP tool — I highly recommend doing so. Setting up Drupal on an Ubuntu Linux box could not be easier (it’s even easier if you are using cloud servers on Rackspace Cloud).

Drupal5 and Drupal6 are the current stable releases of the product. Unless you have some specific compatibility need because of some legacy code or something there is no reason to NOT go with 6. Both are available with apt-get:

sudo apt-get install drupal6

or

sudo apt-get install drupal5

Doing this should set up a folder called /usr/share/drupal5 or /usr/share/drupal6. You’ll need to configure your web server to point to this directory… best bet is via a symbolic link. So if your main rootdocs area is /var/www and you chose to install drupal 6:

cd /var/www
ln -s /usr/share/drupal6 www.mydrupalsite.com

Just in case — Instructions on how to configure Apache.

You complete the Drupal install process by pulling up install.php on your site. Make sure that you are not exposing your drupal site to the world yet! You can do this a variety of ways… for instance setting up a .htaccess file on Apache.

Once everything is secure – just point your browser to install.php on your site and set up your admin account and basic site info. It’s pretty self explanatory.

http://www.yourdurpalsite.com/install.php

Drupal has fairly decent docs that you can dig into here.  Have fun with Drupal!

The Future of the Web

Let’s take a step back and make a gross simplification about what the web is when you get right down to it.  The web is a hypertext.  The web has content producers and content  consumers.   All content has a specific audience.  Everything else is ornamentation.  Please take a moment to let that sink in.  When orbiting on board the international space station the earth is a blue and white ball with bits of brown and green.  We need to get in that same frame of mind as we orbit this thing we call the web.

The web is a hypertext – according to wikipedia’s article “Hypertext is text displayed on a computer or other electronic device with references (hyperlinks) to other text that the reader can immediately access, usually by a mouse click or keypress sequence.” The web’s “texts” are enriched with pictures, video, audio and some degree of interactivity. The text, audio, video and pictures are just …content. If you can see them you are part of the audience.  They were produced by a content producer.  The interactivity you encounter serves one of two purposes 1) to assist you in consuming content (e.g. searching, filtering, navigating) or 2) to assist you in producing content.

Hypertext – producers – consumers – audiences.  That’s it.

Continue reading »

Tags: , , , , , ,

An open letter to people who send passwords in email

Bad pun intended.

Let’s take a moment of silence to lament this terrible practice. I registered for a site today… jumping through the typical hoops required to get to the goodies I wanted in the first place. The site operator decided to use an email validation system. After filling in the typical registration form I hopped over to my email and checked for any new messages in my inbox.

There are three possibile destinations for a validation link email – my inbox, my spam folder or it never showed up. It did show up… another hoop was successfully jumped.

Nothing unusual so far… until I opened it up and saw my user ID and password in plaintext. EMAIL IS NOT SECURE!

So let’s break it down. First here’s a very basic graphic of how this flows:


Step 1

Hopefully when you are filling out your registration form your connection to not.secure.com is https.  To check this just look in the address bar of your browser.  If the address starts with https:// it is secure.

Step 2

The site operator’s server does some crunching on the form data you submitted.  It then looks up the IP address for the domain of the email address you supplied using DNS and initiates an SMTP connection with your email provider.  SMTP is unencrypted.  Data is sent in plain text.

At this point the site operator makes a bad security decision and decides to include your username and password in the email message.

Step 3

Your message has made its journey and is about to land on its final hop — a server for your email provider.  Let’s take a closer look at what happened between Step 2 and Step 3.

Continue reading »

Tags: , ,