mod_rewrite behaving differently on different apache servers. What to do?

Discussion in 'Apache' started by JimRaynor, Nov 3, 2008.

  1. #1
    As part of SEO optimization, I use this code in my .htaccess file :
    RewriteEngine On
    RewriteRule ^some/(.*)/(.*).html$ some.php?&reqa=$1&reqb=$2
    Code (markup):
    This code should rewrite this link:

    some/valuea/valueb.html

    into this:

    some.php?&reqa=valuea&reqb=valueb

    I tried this on several apache servers. On some it works perfectly. On some it doesn't work at all. And on some it rewrites first part of the link, but not query string (part after ? ) . How to configure Apache for this to work? Should I change something in Apache config file? Is there another piece of code that does the same thing, but more consistently?

    Thanks for reading this
     
    JimRaynor, Nov 3, 2008 IP
  2. vovaNux

    vovaNux Peon

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this:

    RewriteRule ^some\/(.*)/(.*)\.html$ some.php?&reqa=$1&reqb=$2

    This should be compliant with all Apache installations
     
    vovaNux, Nov 12, 2008 IP