SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2004
    Location
    England, UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mod_rewrite problems

    I've recently started using mod_rewrite, but the behaviour of a particular rule I am trying to implement is confusing me.

    RewriteRule ^(.*)/node(.*)-(.*)/product/(.*)$ /webstore/viewproduct.php?country=$1&currentNumber=$2&currentIsExpanded=$3&asin=$4

    The URL being rewritten looks like this:

    www.mysite.com/us/node1-0/product/123

    The rewrite rule correctly deposits '1' in currentNumber, '0' in currentIsExpanded, and '123' in asin, but it ends up putting '/webstore/viewproduct.php' in country!

    Can anyone see what I'm doing wrong here?

    Cheers.

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2004
    Location
    New Jersey
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try:
    Code:
    RewriteRule ^(/.*)?/(.*)/node(.*)-(.*)/product/(.*)$  /webstore/viewproduct.php?country=$2&currentNumber=$3&currentIsExpanded=$4&asin=$5


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •