Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    64
    Thanks
    3
    Thanked 1 Time in 1 Post

    Question [solved] Referring URL blanked by mod_rewrite?

    I have a rewrite to make mydomain.com/123 load the script at mydomain.com/links.php?id=123

    links.php generates html with some links on the page. the links are supposed to have the referring url appended to them in the query string ( eg http://whatever.com/s.php?ref=<?=$_SERVER['HTTP_REFERER'];?> ), but it's always blank no matter what.

    would the rewrite cause HTTP_REFERER to be blanked out? what else might cause this?


    Code:
    RewriteEngine on
    Options +FollowSymlinks
    
    RewriteCond %{HTTP_HOST} ^www\.mydomain.com [NC]
    RewriteRule ^(.*) http://mydomain.com/$1 [L,R=301]
    RewriteCond %{REQUEST_URI} !^/$
    RewriteCond %{REQUEST_URI} !^/links\.php
    RewriteCond %{REQUEST_URI} !^/robots\.txt
    RewriteRule ^(.*)$ links.php?id=$1 [L]
    Last edited by gnznroses; 02-08-2012 at 06:43 AM.

  • #2
    New Coder
    Join Date
    Sep 2002
    Posts
    64
    Thanks
    3
    Thanked 1 Time in 1 Post
    hmm, ignore this. just a case of odd browser behavior not passing a referring urls when i use a link on pastehtml. passes just fine on a real test page on my domain


  •  

    Posting Permissions

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