1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Mod_rewrite help

Discussion in 'Apache' started by kalius, May 8, 2005.

  1. #1
    I'm Trying to get clean URLS with mod rewrite on a website I'm working on. I'm having th problem that the php file is being loaded but the variables are not being passed down. Here's what I have:

    RewriteEngine On
    RewriteRule ^index.html$ index.php
    RewriteRule ^(.*)product/(.*)/$ $1product.php?id=$2
    RewriteRule ^(.*)categories/(.*)/(.*) $1categories.php?cat1=$2&cat2=$3
    RewriteRule ^(.*)categories/(.*) $1categories.php?cat1=$2

    Thanks in advance for the help
     
    kalius, May 8, 2005 IP
  2. mjewel

    mjewel Prominent Member

    Messages:
    6,693
    Likes Received:
    514
    Best Answers:
    0
    Trophy Points:
    310
    #2
    Are you sure mod_rewrite is enabled?
     
    mjewel, May 8, 2005 IP
  3. briandunning

    briandunning Active Member

    Messages:
    262
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    98
    #3
    I think all you need to do it lose the $1 from your second term - unless you actually have a file called xxxproduct.php for every possible value of xxx!
     
    briandunning, May 8, 2005 IP
  4. Seiya

    Seiya Peon

    Messages:
    4,666
    Likes Received:
    404
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Indeed that $1 looks weird, its saying you have various .php files... :S
     
    Seiya, May 8, 2005 IP
  5. kalius

    kalius Peon

    Messages:
    599
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks I'll try that out and see what happens.
     
    kalius, May 9, 2005 IP