• Categories

  • Recent Posts

  • Recent Comments

  • Archives





  • OS News

    Microsoft Demonstrates Windows XP on the XO
    The Rise of Contextual User Interfaces
    Introducing QGtkStyle
    OpenSolaris: Shows Promise, Needs Work
    Moonlight Hits the Internet
    'OLPC Could Be the IBM Global Services of Laptop Programs'
    Opera Mini 4.1 Released
    Office 2008 SP1 Released, VBA Support To Return
    Grape: a New Desktop
    Fedora 9 Released
    Windows XP SP3: Problems, Performance Gains
    A History of the Amiga, Part 7: Game on!
    Running X Without Root Privileges
    Microsoft To Discount Windows XP for ULPCs
    Anatomy of Security-Enhanced Linux (SELinux)


    Login

    Genius Tech Blog

    The Genius Speaks on All Things Tech

    .htaccess / mod_rewrite Tutorials

    Saturday, February 23rd, 2008

    The .htaccess file and Apache’s mod_rewrite module may be some of the most under-utilized web server utilities.

    Millions of websites suffer the ignominy and shame of having hardcoded filenames
    on their websites such as:

    http://example.com/index.html

    or unsightly url’s for their (sometimes dynamic) subpages, for example:

    http://example.com/blog/post.php?post_number=1045

    .htaccess and mod_rewrite can dramatically change these unfortunate websites for the better. They may become

    http://example.com

    and

    http://example.com/blog/post/1045

    Not only will the new names be easier to read and more intuitive, they will also be search-engine friendly and one step closer to a proper RESTful methodology.

    For a good introduction to .htaccess, see:
    http://www.crucialwebhost.com/blog/htaccess-apache-rewrites-oh-my/

    There is a good mod_rewrite “cheatsheet” here:
    http://www.ilovejackdaniels.com/cheat-sheets/mod_rewrite-cheat-sheet/

    For more reading on RESTful principles, see:
    http://en.wikipedia.org/wiki/Representational_State_Transfer

    Your Computer Genius. Everybody needs one.

    Copyright © 2008 Your Computer Genius.
    All Rights Reserved.

    Valid XHTML 1.0!   Valid CSS!