mod_rewrite Problem After Server Change

Discussion in 'Apache' started by Darkhodge, Jun 3, 2010.

  1. #1
    Hi guys,


    I'm having a problem with mod_rewrite with a site that recently changed server. The issue is that the "prettified" URLs are working as expected, except for the fact that the URL in the browser is showing the URL with variables etc...

    So for example if my .htaccess file has the following:

    .htaccess
    
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    
    RewriteRule ^([^.]*)\.php$ thisFile.php?firstVar=$1 [L]
    
    Code (markup):
    And I try to access http:// www. domain .com/cars.php it would display the page as excepted, except it would show in the browser the original URL, i.e. http:// www. domain .com/thisFile.php?firstVar=car.

    I'm wondering if someone cold tell me how to solve this issue?


    Thanks!

    Hodge
     
    Darkhodge, Jun 3, 2010 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    try to experiment

    Options +Indexes
    Options +FollowSymlinks

    remove one by one

    then remove both

    To see if it works

    Regards

    Alex
     
    kmap, Jun 3, 2010 IP
  3. Darkhodge

    Darkhodge Well-Known Member

    Messages:
    2,111
    Likes Received:
    76
    Best Answers:
    1
    Trophy Points:
    185
    #3
    Thank you for your response! I actually found the issue was caused by the fact I have rules to redirect non-www to www, and then my site was using non-www for internal linking due to a mistake I made in the coding! Such a simple and yet stupid mistake!

    Thanks again for trying to help though :)
     
    Last edited: Jun 4, 2010
    Darkhodge, Jun 4, 2010 IP