Posted By

eszpee on 01/20/08


Tagged

replace movabletype htaccess tag dash underscore


Versions (?)

Replace _ with - in almost every url (plus nice tag urls in movabletype)


 / Published in: Apache
 

list the exceptions where you don't want to replace in the rewrite rules before the one that matches the underscore, and finish them with [L], otherwise they'll get replaced too.

[N] means rerun the whole replacing stuff once the line matched... careful with that.

  1. RewriteEngine On
  2. RewriteRule ^tag/?$ /browse.html [L]
  3. RewriteRule ^tag/(.*)$ /mt/mt-search.cgi?tag=$1&blog_id=1&IncludeBlogs=1 [L]
  4. RewriteRule ^mt-static(.*)$ - [L]
  5. RewriteRule ^(.*)_(.*)$ $1-$2 [N]

Report this snippet  

You need to login to post a comment.