mod rewrite help (code)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fris
    Too lazy to set a custom title
    • Aug 2002
    • 55679

    #1

    mod rewrite help (code)

    on one of my sites, i am trying to figure out why its not working.

    www.dailybs.com

    here is an example of a media

    http://www.dailybs.com/media/1/chicken-chowmein/

    which doesnt work but

    http://www.dailybs.com/media.php?id=1 does

    any help is grateful


    here is the mod rewrite code

    RewriteEngine on
    RewriteBase /
    RewriteRule ^\.htaccess$ - [F]
    RewriteRule ^trades/([0-9]+)\/*$ trades.php?id=$1
    RewriteRule ^trades\/*$ trades.php
    RewriteRule ^submit\/*$ submit.php
    RewriteRule ^all-media/([0-9]+)\/*$ index.php?page=$1&view=media
    RewriteRule ^send/([0-9]+)\/*$ send.php?id=$1
    RewriteRule ^animations\/*$ index.php?cat=1&view=media
    RewriteRule ^games\/*$ index.php?cat=2&view=media
    RewriteRule ^videos\/*$ index.php?cat=4&view=media
    RewriteRule ^pictures\/*$ index.php?cat=5&view=media
    RewriteRule ^media/([0-9]+)/([^/]+)\/*$ media.php?id=$1&view=media
    RewriteRule ^comments/([0-9]+)\/*$ comments.php?id=$1
    RewriteRule ^rate/([0-9]+)/([1-5])\/*$ index.php?id=$1&rating=$2
    RewriteRule ^contact\/*$ contact.php
    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.
  • psili
    Confirmed User
    • Apr 2003
    • 5526

    #2
    I can spend all day trying to get a mod_rewrite regex working, so here's just a quick guess:

    instead of:
    ^media/([0-9]+)/([^/]+)\/*$ media.php?id=$1&view=media

    did you try:
    ^media/([0-9]+)/([^/]+)\/*$ media.php?id=$2&view=media

    matching against "$2". I think $1 is the first match, which is the entire expression, but I could be wrong. Also, have you tried tailing the logs and the mod_rewrite log files for help ?
    Your post count means nothing.

    Comment

    Working...