How to restrict GET requests from other sites?

Asked

Viewed 178 times

-1

I’m trying to stop other sites from copying my download links, but they’re unconventional (they don’t have format at the end), so I can’t block through Apache mod_rewrite.

So I decided to block GET requests from other sites, but the ways I’ve tested are blocking all requests, including from the site I’m trying to allow.

What I tried unsuccessfully was:

<Limit GET> 

order allow,deny
Allow from exemplo.com
Deny from all

</Limit>
  • 2

    Already answered in block image link to other websites - But beware: it may be desirable to accept referrer blank as well.

  • The following https://serverfault.com/questions/270950/only-allow-get-request-with-htaccess - The DENY ALLOW filters you change

1 answer

-1

I may be right or wrong, but I think that downloading files depends a lot on what is, example, CSS, JS, everything can be downloaded and if the guy finds any. exe, . rar, . png, something she can open link, will be downloaded the same way, so I think it’s a little unnecessary to try to block something, that the net itself makes the guy download, mainly by giving view-source: on your site.

  • I don’t want to hide the downloads, I want them to be blocked on websites that are not mine, because they are consuming a lot of my band. The format of the downloads is example.com/XXX/download. That is, it has no format. I just want to stop the person from copying the HTML from my site and pasting it into another site.

  • understood, so it would be easier for you to use . htaccess as normal link. Example: Rewriterule ([a-Z0-9-]+)/? $ example.com/$1/simple, practical download.

  • Could you give me the full code of how I should enter in . htaccess?

  • Sure, I’ll send you: Rewriteoptions inherit Rewriteengine on Rewriterule ([a-Z0-9-]+)/download? $ index.php? download=$1&file=download

  • you will put in. htaccess and organize the.php downloads format according to your website, remember it will be necessary to 2 GET within the download page, 1º a ? download=FILE and the 2nd &file=download or true

Browser other questions tagged

You are not signed in. Login or sign up in order to post.