The following tutorial explains how to use .htaccess to redirect underscores _ in a tag url to dashes -. This is very important for Search Engine Optimization (SEO) because many search engines including Google do not recognize underscores as spaces between words. They do however, recognize dashes to separate words and tag keyword phrases.
Redirect underscores to dashes using .htaccess:
- Login via ftp to your sites root directory
- Locate and copy your .htaccess file to your desktop
- Using a text editor, add the following lines (replacing yoursite with your actual sitename) to the top of your .htaccess file and save the file:
RewriteRule ^tag/(.*)_(.*)$ http://www.yoursite.com/tag/$1-$2 [R=301,L]
RewriteRule ^tag/(.*)_(.*)$ http://yoursite.com/tag/$1-$2 [R=301,L]
- Upload the new .htaccess file to your sites root directory and enjoy