hyphens not working in htaccess for rewrite (apache 1.3)

  • BooGiE_MaN
  • Proficient
  • Proficient
  • User avatar
  • Posts: 387
  • Loc: Cape Town, South Africa

Post 3+ Months Ago

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
  • joebert
  • Genius
  • Genius
  • User avatar
  • Posts: 13511
  • Loc: Florida

Post 3+ Months Ago

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.

Post Information

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

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.