title: PHP rewrite rules page with slug dash like page-about not working
body: <p>This code is working fine but the problem is dash - if i add a page in single text named like <code>'category'  =&gt; &quot;/category/(?'category'[\w\-]+)&quot;, </code> it is working fine and when i want to add the dash like this <code>'product-category'  =&gt; &quot;/product-category/(?'product-category'[\w\-]+)&quot;,</code> then it is not working. What i am missing?</p>
  <pre><code>define( 'INCLUDE_DIR', dirname( __FILE__ ) . '/' );
  
  $rules = array( 
      'picture'           =&gt; &quot;/picture/(?'text'[^/]+)/(?'id'\d+)&quot;,              // '/picture/some-text/51'
      'album'             =&gt; &quot;/album/(?'album'[\w\-]+)&quot;,                        // '/album/album-slug'
      'product-category'  =&gt; &quot;/product-category/(?'product-category'[\w\-]+)&quot;,  // '/product-category/category-slug'
      'product'           =&gt; &quot;/product/(?'product'[\w\-]+)&quot;,                    // '/product/product-slug'
      'page'              =&gt; &quot;/page/(?'page'about|contact)&quot;,                    // '/page/about', '/page/contact'
      'post'              =&gt; &quot;/(?'post'[\w\-]+)&quot;,                               // '/post-slug'
      'home'              =&gt; &quot;/&quot;                                                // '/'
  );
  
  $uri = rtrim( dirname($_SERVER[&quot;SCRIPT_NAME&quot;]), '/' );
  $uri = '/' . trim( str_replace( $uri, '', $_SERVER['REQUEST_URI'] ), '/' );
  $uri = urldecode( $uri );
  
  foreach ( $rules as $action =&gt; $rule ) {
      if ( preg_match( '~^'.$rule.'$~i', $uri, $params ) ) {
          include( INCLUDE_DIR . $action . '.php' );
          exit();
      }
  }
  
  include INCLUDE_DIR . 'header.php'; 
  include INCLUDE_DIR . '404.php';
  include INCLUDE_DIR . 'footer.php';
  </code></pre>