Current location: Hot Scripts Forums » Programming Languages » Perl » mod rewrite problem


mod rewrite problem

Reply
  #1 (permalink)  
Old 10-16-05, 11:50 PM
gnznroses gnznroses is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Arrow mod rewrite problem

i'm using mod reweite to get search engine friendly urls. i have rules so far which turn this:
Code:
http://www.bashbargains.com/SearchIndex-Electronics_BrowseNameNode-Electronics.html
into this:
Code:
http://www.bashbargains.com/cgi-bin/shop_test.cgi?SearchIndex=Electronics&BrowseNameNode=Electronics


Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^(.+)-(.+)_(.+)-(.+)_(.+)-(.+)_(.+)-(.+)_(.+)-(.+)_(.+)-(.+)\.html$ /cgi-bin/shop_test.cgi?$1=$2&$3=$4&$5=$6&$7=$8&$9=$10&$11=$ 12
RewriteRule ^(.+)-(.+)_(.+)-(.+)_(.+)-(.+)_(.+)-(.+)_(.+)-(.+)\.html$ /cgi-bin/shop_test.cgi?$1=$2&$3=$4&$5=$6&$7=$8&$9=$10
RewriteRule ^(.+)-(.+)_(.+)-(.+)_(.+)-(.+)_(.+)-(.+)\.html$ /cgi-bin/shop_test.cgi?$1=$2&$3=$4&$5=$6&$7=$8
RewriteRule ^(.+)-(.+)_(.+)-(.+)_(.+)-(.+)\.html$ /cgi-bin/shop_test.cgi?$1=$2&$3=$4&$5=$6
RewriteRule ^(.+)-(.+)_(.+)-(.+)\.html$ /cgi-bin/shop_test.cgi?$1=$2&$3=$4
RewriteRule ^(.+)-(.+)\.html$ /cgi-bin/shop_test.cgi?$1=$2


ok, it works, except i want to also shorten the names of the paramaters, and these rules for some reason will not work:

# shorten param names
RewriteRule ^(.+)SI=(.+)$ $1SearchIndex=$2
RewriteRule ^(.+)BNN=(.+)$ $1BrowseNodeName=$2

i have my cgi script printing out the query string and it prints it out just with SI and BNN, not the expanded name. i don't understand why. tried several variations. i also tried puttin it at the beggining of the rule set, before the "-"s are turned into "="s, and using this:

RewriteRule ^(.+)SI-(.+)$ $1SearchIndex-$2
RewriteRule ^(.+)BNN-(.+)$ $1BrowseNodeName-$2


but ti still doesn't work...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-03-05, 12:05 AM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
If you still need help with this I recommend hunting for a good Apache list. Not many people hang around the Perl list here and I always have troubles with mod_rewrite myself. If you did come up with a fix, I'd like to see it for my reference

~Charlie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-03-05, 12:12 AM
gnznroses gnznroses is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
no fix yet. but i haven't worke don it at all for a long time. my host said not to do it...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 11-03-05, 12:17 AM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Bummer. Too much overhead on the server? Using a lot of rewrite rules can ad up to a few CPU cycles.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 11-03-05, 12:24 AM
gnznroses gnznroses is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
yep. especially when google is indexing 20,000 pages...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mod rewrite help with perl script Gastongr Perl 1 10-11-05 09:55 AM
Great new phpbb Mod on_way_to_fame General Advertisements 5 04-01-05 03:41 PM
Some mod rewrite help jasong PHP 4 01-02-05 02:04 AM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 10:13 AM
classified ads with mod rewrite hopalong Script Requests 0 07-24-04 10:58 PM


All times are GMT -5. The time now is 12:16 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.