Checkout these great crochet books, movie and TV DVDs (some are so new they aren't published yet! pre-order them at amazon.com!), and other items I enjoy or are on my wish list!

Redirect URLs with underscores to URLs with dashes (hyphens)

| No Comments


After all the re-publishing and researching I did yesterday, I realized that the filenames on my old blog site used underscores - not dashes - and, because of that, some links were broken on this new blog! Ack! (I knew I wanted to use dashes so I thought I had already been using dashes on the old blog!) I was by then too tired to try to fix it.

Today, however, I was ready to tackle this new problem! A Google search for "htaccess underscores dashes" revealed just what I needed! Using .htaccess Voodoo For Underscore and Dash Woes provides the solution with the exact lines to copy and paste into the .htaccess file. Changes I made:

  • There were 2 extra spaces that caused 500 errors until I removed them from the last and next-to-last lines just before \.html$
  • Changed "RewriteBase /" to the subdirectory for this blog, i.e., "RewriteBase /blog/"
  • Since I use .php extensions, I changed .html to .php
  • Added lines for $7, $8, $9 ,$10, and $11 because full titles use more than 6 words in some cases

Works like a charm!

[Update October 28, 2007] It seems that the wildcards go to only $9. So I added this line (it's one line, not three!) above the $9 line - it catches the first nine wildcard variables then the lines below this one catch the rest.

RewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)
_([^_]*)_([^_]*)_(.*)\.php$
http://www.tamemymind.com/$1-$2-$3-$4-$5-$6-$7-$8-$9.php

Leave a comment

Sketch of Cheryl

About Cheryl

Enjoys crocheting, gardening, cats, NASCAR (especially Tony Stewart and Kyle Busch!), reading, photography, snorkeling in Kailua-Kona with sea turtles, Sizzler's Mega Bacon Cheeseburgers, hot and iced decaf coffee, dark chocolate, color (yarn, fabric), playing around with web technologies - not necessarily in that order! Still very much a beginner with quilting, knitting, and sewing. Donates crocheted lap blankets.

List maker, detail-oriented, organized, leans heavily toward perfectionism. ISTJ. Libra.

Late 40s. Married to Bill. Son Greg and daughter-in-law Lauren live in Oregon. Stepson Billy and daughter-in-law Rowena are in Maui, Hawaii. Stepson Bryan lives in the Bay Area.

Web Designer for a college in the Bay Area, California. Strives for web accessibility, web standards, valid XHTML, valid CSS.

Tea Party Patriots.
Fiscal responsibility, limited government, free markets.
www.teapartypatriots.org

January 2012

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

I Care About

(Most links open new window.)

  • My wonderful cat Cleo.
  • Give Life. Donate Blood. Red Cross.
  • Learn about breast cancer at BreastCancer.org
  • Tony Stewart 14
  • Stewart-Haas Racing
  • Kyle Busch 18
  • NASCAR
  • YOU on a Diet - RealAge.
  • Get the Firefox web browser - it's Safer, Faster, Better!

TMM Blog ClustrMap

Locations of visitors to this page

Disclaimer

This is a personal website - my place of self expression. The views expressed are mine alone and do not necessarily reflect the views of my employer or any other organization I am a member of or affiliated with.

OpenID accepted here Learn more about OpenID
Creative Commons License
This blog is licensed under a Creative Commons License.
Powered by Movable Type 5.04

About this Entry

This page contains a single entry by Cheryl published on October 22, 2007 7:05 AM.

More MT 4 configuration notes was the previous entry in this blog.

Use sed to change string1 to string2 in same file is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

Categories

Cat playing with strand of yarn.