CartKeeper E-Commerce Solutions

CartKeeper User Forum
 
  FAQFAQ   SearchSearch    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Rewrite URLs underscores to dashes

 
Post new topic   Reply to topic    CartKeeper E-Commerce Solutions Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
erik
Jr. Member


Joined: 24 Oct 2005
Posts: 65

PostPosted: Mon May 11, 2009 2:25 pm    Post subject: Rewrite URLs underscores to dashes Reply with quote

To change your rewrite rules to use dashes instead of underscores, use these rewrite rules:

RewriteEngine on
RewriteRule ^category/[0-9A-Za-z\-]+/c?([0-9]+)?m?([0-9]+)?p?([g0-9]+)?a?(1)?n?(1)?s?(1)?/?$ /category.php?category_id=$1&manufacturer_id=$2&page=$3&all=$4&new=$5&sale=$6
RewriteRule ^manufacturer/[0-9A-Za-z\-]+/([0-9]+)/?([0-9]+)?/?$ /category.php?manufacturer_id=$1&category_id=$2
RewriteRule ^item/[0-9A-Za-z\-]+/([0-9]+)/?p?([g0-9]+)?c?([0-9]+)?m?([0-9]+)?/?$ /item.php?item_id=$1&page=$2&category_id=$3&manufacturer_id=$4
RewriteRule ^content/[0-9A-Za-z\-]+/([0-9]+)/?$ /content.php?content_id=$1
RewriteRule ^sale/?$ /category.php?sale=1
RewriteRule ^new/?$ /category.php?new=1
RewriteRule ^all/?$ /category.php?all=1
RewriteRule ^all_manufacturers/?$ /category.php?all_mfg=1

and change this code in /inc/url_def.php:

Code:
$REWRITE->replace_pattern = array('/&/', '/[^0-9A-Za-z_]+/');
$REWRITE->replace_char = array('and', '_');


to:

Code:
$REWRITE->replace_pattern = array('/&/', '/[^0-9A-Za-z\-]+/');
$REWRITE->replace_char = array('and', '-');
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CartKeeper E-Commerce Solutions Forum Index -> Tips and Tricks All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group