ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Mod Rewrite URL to use hyphens instead of underscores

January 01, 2013 9:26am

Subscribe [2]
  • #1 / Jan 01, 2013 9:26am

    Terence Hall

    15 posts

    I’m moving my website from host to another.  In addition, I would like to change my url structure.  My url’s currently use underscores but I want to change the hyphens

    From:
    http://www.website.com/article/my_web_content

    To:
    http://www.website.com/article/my-web-content

    How can I use .htaccess mod rewrite to achieve this?

    Thanks in advance

  • #2 / Mar 26, 2013 10:44am

    syed

    1 posts

    Try this option in route.php ->

    $route[’(.*)-(.*)/(.*)-(.*)’] = ‘$1_$2/$3_$4’;
    $route[’(.*)/(.*)-(.*)’] = ‘$1/$2_$3’;
    $route[’(.*)-(.*)’] = ‘$1_$2’;

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases