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.

Problem with rewrite and 'wic'

Discussion in 'Apache' started by stepster, Nov 23, 2005.

  1. #1
    I have a rewrite in my httpd.conf to convert URLs to pull out dynamic content:


    RewriteCond %{REQUEST_URI} !^/images*
    RewriteCond %{REQUEST_URI} !^/.*.php*
    RewriteCond %{REQUEST_URI} !^/.*.ico*
    RewriteCond %{REQUEST_URI} !^/.*.txt*
    RewriteCond %{REQUEST_URI} !^\/$
    RewriteRule ^/(.*)$ /loader.php\?loc=$1&%{QUERY_STRING} [L]


    It works fine with anything such as www.mydomain.com/widget going to www.mydomain.com/loader.php?loc=widget which is exactly what I want.

    That is, until my URL contains 'wic' somewhere in it!

    For example:
    www.mydomain.com/wic
    www.mydomain.com/wic/widget
    www.mydomain.com/warwick
    www.mydomain.com/middlewich

    All of these are completely ignored by my rewrite rule and fall through the bottom giving me a 404.

    Why? I cannot see any reason for this! Can anyone offer any advice or pointers?

    I'm using Apache/2.0.55 on WinXP Pro
     
    stepster, Nov 23, 2005 IP
  2. johnt

    johnt Peon

    Messages:
    178
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not sure if this will have any impact or not, but you could try replacing the RewriteRule with
     RewriteRule ^/(.*)$ /loader.php\?loc=$1 [L,QSA]
    Code (markup):
    The QSA flag tells the rewrite engine to append the existing query string if one exists.
    Other than that remote possibility, I can't see anything that would cause the issues that you're describing I'm afraid
     
    johnt, Nov 23, 2005 IP
  3. stepster

    stepster Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No, unfortunately that didn't solve the problem.

    Further, I've discovered that it's not just 'wic' but anything with 'ic' in it. But not something starting 'ic'

    Any other ideas out there? Anyone else seeing anything similar?
     
    stepster, Nov 24, 2005 IP
  4. stepster

    stepster Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    And as soon as I typed my reply, I worked out the problem!

    It's my exclusion to cope with the dreaded favicon.ico

    By removing that line, the problem has gone away. :)
     
    stepster, Nov 24, 2005 IP