Mod Rewrite....

Discussion in 'Apache' started by ozband, Oct 6, 2005.

  1. #1
    Hi there,

    I have a php script i would like to have mod rewritten from dynamic to static.

    It is www.axetabs.com

    I have tried to use this following coding, but when i visit the static url, none of the images show up??? And i then had to take it out of htaccess cuz i was getting internal server error 500 ???

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^m/(.*)/c/(.*).html$ guitartabs.php?m=$1&c=$2 [L]
    RewriteRule ^m/(.*)/lid/(.*).html$ guitartabs.php?m=$1&lid=$2 [L]
    RewriteRule ^m/(.*)/a/(.*).html$ guitartabs.php?m=$1&a=$2 [L]

    http://www.axetabs.com/guitartabs.php?m=c&c=c
    http://www.axetabs.com/m/c/c/c.html

    http://www.axetabs.com/guitartabs.php?m=s&lid=64
    http://www.axetabs.com/m/s/lid/64.html

    http://www.axetabs.com/guitartabs.php?m=a&a=Absurd+(DE)
    http://www.axetabs.com/m/a/a/Absurd+(DE).html

    Anyhow, i have no idea where to go from here so if somebody is interested in mod rewriting it for me, send a quote my way.. :)
     
    ozband, Oct 6, 2005 IP
  2. boccio

    boccio Peon

    Messages:
    82
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Images are not showing up because of the paths.

    If you have guitartabs.php in root, and rewrite engine is taking it to some m/c/c/c subfolder, then images in the guitartabs file also "think" they are in specified folder.

    For files that are affected by rewrite engine use either absolute path to images, or define some $root variable and prefix the images with it.
     
    boccio, Oct 6, 2005 IP
  3. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi,
    either adjust the pics or do a "flat" rewrite

    RewriteRule ^mc-(.*)-(.*).html$ guitartabs.php?m=$1&c=$2 [L]

    You don't have to have this cracy notion of subdirectories.

    Don't forget to adjust your internal nav to the rewritten new static pages - otherwise it's a bit beside the point.

    Expat

    PS the ^mc you can use whatever name you can think off instead of mc but do not use blank or a name that already exists- the rewrite will present the first var(.*) as m= etc......

    PPS If it works link to me
     
    expat, Oct 6, 2005 IP
  4. Jim bob 9 pants

    Jim bob 9 pants Peon

    Messages:
    890
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I am having the same problem, how do I
    Thank you!!!

    JB9P
     
    Jim bob 9 pants, Nov 27, 2005 IP