Mod rewrite problem with +

Discussion in 'Apache' started by turifungia, Nov 24, 2007.

  1. #1
    turifungia, Nov 24, 2007 IP
  2. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    not sure 100% what you are asking for
    are they visiting www.site.com/test_test2.html ?
    if so

    RewriteRule ^([a-zA-Z0-9]+)_([a-zA-Z0-9]+).html$ index.php?tag=$1+$2 [L,NC]

    should do
    if they are visiting www.site.com/index.php?tag=test+test2 then i'm not sure how to do that.

    You would need to change the code in your application to point to the .html file instead.
     
    powerspike, Nov 24, 2007 IP
  3. turifungia

    turifungia Well-Known Member

    Messages:
    465
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #3
    turifungia, Nov 24, 2007 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)\.html$ index.php?tag=$1 [L]

    You'll have to edit the script so it changes the + to _ since you have to make it also link that way.
     
    Nintendo, Nov 24, 2007 IP