Download the PHP package stevie-ray/referrer-spam-blocker without Composer

On this page you can find all versions of the php package stevie-ray/referrer-spam-blocker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package referrer-spam-blocker

Referrer Spam Blocker :robot:

Apache, Nginx, IIS, uWSGI, Caddy & Varnish blacklist + Google Analytics segments to prevent referrer spam traffic


Latest Stable Version Build Status Libraries.io dependency status for latest release Code Quality Packagist License


Apache: .htaccess

.htaccess is a configuration file for use on web servers running Apache. This file is usually found in the root “public_html” folder of your website. The .htaccess file uses two modules to prevent referral spam, mod_rewrite and mod_setenvif. Decide which method is most suitable with your Apache server configuration. This file is Apache 2.4 ready, where mod_authz_host got deprecated.

Nginx: referral-spam.conf

With referral-spam.conf in /etc/nginx, include it globally from within /etc/nginx/nginx.conf:

Add the following to each /etc/nginx/site-available/your-site.conf that needs protection:

Varnish: .refferal-spam.vcl

Add referral-spam.vcl to Varnish 4 default file: default.vcl by adding the following code right underneath your default backend definitions

IIS (Internet Information Services): web.config

The web.config file is located in the root directory of your Windows Server web application.

Caddy (HTTP/2 Web Server with Automatic HTTPS): referral-spam.caddy and referral-spam.caddy2

Move this file next to your Caddy config file, and include it by doing:

# For Caddy 1:
 include ./referral-spam.caddy;
# For Caddy 2:
 import ./referral-spam.caddy2

Then start your caddy server. All the referrers will now be redirected to a 444 HTTP answer

uWSGI: referral_spam.res

Include the file referral_spam.res into your vassal .ini configuration file:

HAProxy: referral-spam.haproxy

Use it in your HAProxy config by adding all domains.txt items, in any frontend, listen or backend block:

Options for Google Analytics 'ghost' spam

The above methods don't stop the Google Analytics ghost referral spam (because they are hitting Analytics directly and don't touching your website). You should use filters in Analytics to prevent ghost referral spam and hide spam form the past. Because Google Analytics segments are limited to 30.000 characters the exclude list is separated into multiple parts.

Navigate to your Google Analytics Admin panel and add these Segments:

Filter Session Include
Hostname matches regex
Filter Session Exclude
Source matches regex Copy all the domains from google-exclude-1.txt to this field

Do the same for google-exclude-2.txt. Please note there may be more files in the future.

You can also prevent ghost referral spam by:

Intregrate in a Dockerfile

You can also integrate these configuration file in your Docker repo, so you will get always the most updated version when you build your image. For Apache, Nginx, Varnish 4 or IIS add the following line to your Dockerfile

Like it?


All versions of referrer-spam-blocker with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stevie-ray/referrer-spam-blocker contains the following files

Loading the files please wait ....