Tag: dashes

  • Using .htaccess Voodoo For Underscore and Dash Woes

    September 20, 2007

    Here’s a little tip for people who have recently switched to dashes (-) from underscores (_) as word separators and wish all those old inbound links could still work. Try this in your .htaccess file: Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*).html$ http://example.com/$1-$2-$3-$4-$5-$6.html [R=301,L] RewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*).html$ http://example.com/$1-$2-$3-$4-$5.html [R=301,L] RewriteRule ^([^_]*)_([^_]*)_([^_]*)_(.*).html$ http://example.com/$1-$2-$3-$4.html [R=301,L] RewriteRule ^([^_]*)_([^_]*)_(.*)... Read More