Results 1 to 7 of 7

Thread: apache mod_rewrite help

  1. #1
    I'm a farmhand on your dad's rooster ranch. haganxy's Avatar
    Join Date
    Dec 2004
    Location
    Seattle, WA
    Posts
    379

    apache mod_rewrite help

    i was 100% sure my .htaccess/mod_rewrite was working, but now it seems to have stopped working.

    this is what i want it to do:

    if there is NO HTTP_REFERER, then redirect the customer to www.yahoo.com. but it's not working ( i get cannot find server or permission denied errors )

    here is my .htaccess file. can anyone help?


    RewriteEngine on

    RewriteCond %{HTTP_REFERER} ^$
    RewriteRule ^(.*)$ http://www.yahoo.com/ [L,F]
    hagan - IT nerd
    PrideBucks.com
    ICQ: 49962103


  2. #2
    JustMe
    Guest
    Try sticking

    Options +FollowSymlinks

    at the top of that


  3. #3
    I'm a farmhand on your dad's rooster ranch. haganxy's Avatar
    Join Date
    Dec 2004
    Location
    Seattle, WA
    Posts
    379
    Quote Originally Posted by JustMe
    Try sticking

    Options +FollowSymlinks

    at the top of that

    thanks for the help, but it still doesn't work. and i made sure apache will allow FollowSymlinks override:

    AllowOverride All
    hagan - IT nerd
    PrideBucks.com
    ICQ: 49962103


  4. #4
    I'm a farmhand on your dad's rooster ranch. haganxy's Avatar
    Join Date
    Dec 2004
    Location
    Seattle, WA
    Posts
    379
    i figured it out.

    RewriteRule ^(.*)$ http://www.yahoo.com/ [L,F]


    should be:

    RewriteRule ^(.*)$ http://www.yahoo.com/ [L,R]


    "R" not "F"
    hagan - IT nerd
    PrideBucks.com
    ICQ: 49962103


  5. #5
    Soonnow
    Guest

    I Wonder? Butting in here...

    I was under the impression that when a surfer
    opens a link "in a new window" the target server
    won't get a referrererrerer ... ? (only in FireFox?)
    - Wouldn't you be dumping a lot of potentials by
    rerouting them to Yahoo ?


  6. #6
    virgin by request ;) Chilihost's Avatar
    Join Date
    Oct 2003
    Posts
    4,496
    Hagan, glad to see you caught that typo, htaccess is very very fussy with its syntax, you miss one little bit of syntax and the whole thing not only stops working but can also messes up normal access on your site too.

    Soonnow, I think yahoo.com is just a sample URL, I am sure he is not redirecting surfers there!!!

    cheers,
    Luke


  7. #7
    I'm a farmhand on your dad's rooster ranch. haganxy's Avatar
    Join Date
    Dec 2004
    Location
    Seattle, WA
    Posts
    379
    yes, www.yahoo.com is just a sample URL, it was just a placeholder.
    hagan - IT nerd
    PrideBucks.com
    ICQ: 49962103


Posting Permissions

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