hyphens not working in htaccess for rewrite (apache 1.3)

  • BooGiE_MaN
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jun 05, 2005
  • Posts: 387
  • Loc: Cape Town, South Africa
  • Status: Offline

Post March 2nd, 2010, 5:06 am

APACHE Code: [ Select ]
RewriteRule ^([a-z]+)/([1-9]|[1-9]([0-9]+))/([a-z0-9\-\/]+)$ index.php?content=$1&id=$2


Code: [ Select ]
index.php?content=test&id=1  ==>  test/1/some-text/more-text


It works on my PC (Wamp, with Apache 2), but when I upload to the server (Apache 1.3) it does not work when the last part of the URL has a hyphen (-)

Anyone else ever experienced this and how do I fix it?
Moderator Remark: Corrected title

Simply Links Directory
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 2nd, 2010, 5:06 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post March 2nd, 2010, 10:40 am

Issues like this when going from Apache 1.x to Apache 2.x seem to revolve around Apache moving to PERL 5 regular expression syntax in Apache 2.0

The only thing I can think to try without digging through old Apache 1.3 manual pages is to move your escaped hyphen to the end of your range after the escaped forward slash and try it with the hyphen both escaped and unescaped. I seem to remember something about hyphens only being interpreted literally if they're the last character in the range but I'm not sure on that.
Strong with this one, the sudo is.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 170 guests
  • 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 post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.