Please help me with .htaccess code...

Discussion in 'Apache' started by abraxas, Jun 26, 2014.

  1. #1
    Hi all,

    I would like to ask for some help.
    I have blocked all the referrers from few TLDs via .htaccess
    I want to ask if somebody can help me to exclude a single or few URLs from those.

    What I need is to keep these TLD referrals blocked, but allow an exception for yandex.ru for example?
    Any ideas?

    Thanks very much in advance!!!

    p.s. I cannot add the exact code here as DP returns some error, but it is correct - I just cannot exclude a single URL...
     
    abraxas, Jun 26, 2014 IP
  2. fare

    fare Well-Known Member

    Messages:
    89
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    145
    #2
    Is this alright with you? It basically allow referrers from yandex.ru and deny all other referrers.

    or let's say you want to allow referrers from yandex.ru while deny other referrers from only .ru and .cn TLD (amend the list accordingly).

    Hope it works for you! :)
     
    Last edited: Jul 6, 2014
    fare, Jul 6, 2014 IP
    abraxas likes this.
  3. abraxas

    abraxas Well-Known Member

    Messages:
    1,422
    Likes Received:
    44
    Best Answers:
    1
    Trophy Points:
    125
    #3
    Thank you very much!!!
    It should work, I have to go out now, but will try it out tomorrow.
    Cheers and thanks again!
     
    abraxas, Jul 6, 2014 IP