PHP5 and Redirection with .htaccess problem

Discussion in 'Apache' started by trigoon, Jan 30, 2008.

  1. #1
    Im running on a server using PHP5 and trying to do this:

    When someone goes to mydomain.com/folder they are redirected depending on if they have a referrer. If they have a referer they are taken to mydomain.com/folder/index.php and if they dont they go to mydomain.com/folder/index.html.

    Im using this code:
    RewriteCond %{HTTP_REFERER} ^$
    RewriteRule test/index.html http://mydomain.com/test/index.php [R,L,NC]

    But it doesnt seem to be working. It works on a hosting account I own with hostgator but not on this server. Anyone know why?
     
    trigoon, Jan 30, 2008 IP
  2. buldozerceto

    buldozerceto Active Member

    Messages:
    1,137
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    88
    #2
    Remove the L flag, it doesn't work on some hosts
    And Also try putting RewriteBase / or RewriteBase /folder depending where htaccess is.
     
    buldozerceto, Jan 30, 2008 IP