ini htaccess spip
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini htaccess spip相关的知识,希望对你有一定的参考价值。
##############################################################
# Fichier .htaccess SPIP v 3 #
# #
# V 1.1.4 #
# #
# Permet de controler les URLs et la version de php utilisee #
# Compatible avec les URLs 'html', 'propres' et 'propres2' #
# Permet aussi d'effectuer la transition de .PHP 3 vers .PHP #
# #
# Pour utiliser ce fichier renommez-le '.htaccess' dans le #
# repertoire racine du site, en veillant a ne pas ecraser un #
# .htaccess personnalise qui s'y trouverait deja #
# #
# Attention certains hebergeurs desactivent tout ou partie #
# des fonctions du fichier .htaccess ; celui-ci est donc #
# indicatif - en cas de difficulte voir sur les forums SPIP #
##############################################################
# https://httpd.apache.org/docs/2.4/fr/rewrite/flags.html
# https://github.com/h5bp/server-configs-apache/blob/master/dist/.htaccess
# https://core.spip.net/projects/spip/repository/entry/spip/htaccess.txt
## A remplacer par le nom du domaine :
# __DOMAIN__ : ex domaine.fr
RewriteEngine On
# Ne pas lister les répertoires
Options +FollowSymlinks -Indexes
################ CONFIGURATION ######################
### Configuration sous-repertoire
# Calcule automatiquememt le RewriteBase (qui permet de faire fonctionner
# les belles URLs). De la sorte, un meme site peut etre affiche en racine
# ou dans un sous repertoire sans devoir modifier la ligne RewriteBase.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
# En alternative aux 2 lignes precedentes (a commenter dans ce cas),
# vous pouvez indiquer un RewriteBase specifique
# RewriteBase /
################ REGLAGES PERSONNALISES ######################
# http://www.joshuawinn.com/fix-html5-validator-error-bad-value-x-ua-compatible-for-attribute-http-equiv-on-element-meta/
Header set X-UA-Compatible "IE=Edge,chrome=1"
## https://sonarwhal.com/scanner/
## https://www.keycdn.com/support/x-content-type-options/
Header set X-Content-Type-Options "nosniff"
# Rediriger rediriger monsite.tld vers wwww.monsite.tld
# http://www.webrankinfo.com/dossiers/techniques/redirection-301-www
# RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# Forcer le passage des adresses vers le https
# http://www.webrankinfo.com/dossiers/techniques/redirection-http-https
# Testeur de config ssl : https://www.linksspy.com/seo-tools/free-seo-ssl-scan/
# RewriteCond %{SERVER_PORT} 80
# RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Rediriger les pages sans www vers celles avec www
#RewriteCond %{HTTP_HOST} ^__DOMAIN__
#RewriteRule (.*) https://www.__DOMAIN__$1 [R=301,L]
## URLS PAGES PERSOS
#RewriteRule ^collections(\.html)?$ spip.php?page=collections [QSA,L]
#RewriteRule ^collection/([^/]*)\.html$ spip.php?page=collection&collection=$1 [QSA,L]
## Filtre image_responsives
#<IfModule xmod_sendfile.c>
#XSendFile on
#RewriteRule (.*)\-resp([0-9]+v?)(\-([0-9\.]+))?\.(jpg|png|gif) index.php?action=image_responsive&img=$1.$5&taille=$2&dpr=$4&xsendfile=1
#</IfModule>
#RewriteRule (.*)\-resp([0-9]+v?)(\-([0-9\.]+))?\.(jpg|png|gif) index.php?action=image_responsive&img=$1.$5&taille=$2&dpr=$4
## REGLES DE REECRITURE DES PAGES
RewriteRule ^plan-du-site(\.html)?$ spip.php?page=plan [QSA,E=url_propre:$0,L]
################ GESTIONS DES URLS SPIP #######################
# Deux pseudo-actions a present evacuees
# N'y at-il pas moyen de REMPLACER un nom dans la QueryString ?
RewriteCond %{QUERY_STRING} action=rss
RewriteRule spip.php spip.php?page=rss [QSA,L]
RewriteCond %{QUERY_STRING} action=ical
RewriteRule spip.php spip.php?page=ical_prive [QSA,L]
###
# Si le fichier ou repertoire demande existe
# ignorer toutes les regles qui suivent
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule "." - [skip=100]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule "." - [skip=100]
#
###
###
# Compatibilite avec les URLS "html" (pour transition sympa)
# voir fichier ecrire/urls/html.php
RewriteRule ^rubrique([0-9]+)(\.html)?$ spip.php?page=rubrique&id_rubrique=$1 [QSA,L]
RewriteRule ^article([0-9]+)(\.html)?$ spip.php?page=article&id_article=$1 [QSA,L]
RewriteRule ^breve([0-9]+)(\.html)?$ spip.php?page=breve&id_breve=$1 [QSA,L]
RewriteRule ^mot([0-9]+)(\.html)?$ spip.php?page=mot&id_mot=$1 [QSA,L]
RewriteRule ^auteur([0-9]+)(\.html)?$ spip.php?page=auteur&id_auteur=$1 [QSA,L]
RewriteRule ^site([0-9]+)(\.html)?$ spip.php?page=site&id_syndic=$1 [QSA,L]
# Compatibilite avec les anciennes URLS appelant directement des fichiers php
RewriteRule ^(rubrique|article|breve|mot|auteur|site|agenda|backend|backend-breves|distrib|forum|ical|plan|recherche|sommaire|sommaire_texte)\.php3?$ spip.php?page=$1 [QSA,L]
RewriteRule ^resume.php[3]? spip.php?page=sommaire [QSA,L]
RewriteRule ^page.php[3]? spip.php [QSA,L]
RewriteRule ^spip_cal\.php3?$ spip.php?page=ical_prive [QSA,L]
RewriteRule ^spip_rss\.php3?$ spip.php?page=rss [QSA,L]
# Fin compatibilite
###
###
# ping http://site/1234 => article1234
RewriteRule ^([1-9][0-9]*)$ spip.php?action=redirect&type=article&status=301&id=$1 [QSA,L]
#
###
###
# APIs
# http://site/xmlrpc.api
# http://site/atom.api/articles/1234
RewriteRule ^([\w]+)\.api(/(.*))?$ spip.php?action=api_$1&arg=$3 [QSA,L]
# Fin des APIs
###
###
# URLs "propres", "propres2", "libres", "arbo"
RewriteRule ^[^\.]+(\.html)?$ spip.php [QSA,E=url_propre:$0,L]
# Fin URLs "propres" et "propres2"
###
###
# Divers
# bloquer les acces aux fichiers caches (.svn, .git, etc)
RewriteRule /\\..*(/.*|$) - [F]
## spam de sites référents
##
###
# Fichiers "standards" (si absents de la racine)
#
RewriteRule ^robots[.]txt$ spip.php?page=robots.txt [QSA,L]
RewriteRule ^favicon[.]ico$ spip.php?page=favicon.ico [QSA,L]
RewriteRule ^sitemap[.]xml$ spip.php?page=sitemap.xml [QSA,L]
##
# expirer les images (pour contourner gros bug MSIE sur le cache)
# note : a decommenter si vous voulez tester
#<IfModule mod_expires.c>
# ExpiresActive on
# ExpiresByType image/gif A3600
# ExpiresByType image/jpeg A3600
# ExpiresByType image/png A3600
#</IfModule>
# Allow-cross-rigin
# https://developer.mozilla.org/fr/docs/Web/HTTP/CORS
# Add type
# https://stackoverflow.com/questions/2856502/css-font-face-not-working-with-firefox-but-working-with-chrome-and-ie?rq=1
AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff
AddType font/woff .woff2
# Fix cross origin requests CORS issues for webfonts
# https://crunchify.com/how-to-fix-access-control-allow-origin-issue-for-your-https-enabled-wordpress-site-and-maxcdn/
for webfonts
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|otf|eot|woff|woff2)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
# Fix cross origin requests CORS issues ALL
# allow js, css, webfont useful mainly for static pages with lots of CDN assets
# https://developer.mozilla.org/fr/docs/Web/HTTP/CORS
# https://crunchify.com/how-to-fix-access-control-allow-origin-issue-for-your-https-enabled-wordpress-site-and-maxcdn/
#<IfModule mod_headers.c>
# <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
# Header set Access-Control-Allow-Origin "*"
# </FilesMatch>
#</IfModule>
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
#
# These are pretty far-future expires headers
# They assume you control versioning with cachebusting query params like:
# <script src="application.js?20100608">
# Additionally, consider that outdated proxies may miscache
#
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
#
# If you don`t use filenames to version, lower the css and js to something like "access plus 1 week"
#
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Your document html
ExpiresByType text/html "access plus 0 seconds"
# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# RSS feed
ExpiresByType application/rss+xml "access plus 1 hour"
# Favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"
# Media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# Webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# CSS and JavaScript
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
# ----------------------------------------------------------------------
# Gzip compression
# https://github.com/h5bp/server-configs-apache/blob/master/dist/.htaccess
# ----------------------------------------------------------------------
<IfModule mod_deflate.c>
# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
# HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
# En apache 2.4 les FILTERProviders change de syntaxe
# https://github.com/Laverna/laverna/issues/110
# https://community.ovh.com/t/faq-comment-mettre-a-jour-mon-site-pour-supporter-apache-2-4/3850
<IfModule mod_version.c>
<IfModule filter_module>
# APACHE > 2.4
<IfVersion >= 2.4>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/html'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/css'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/plain'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/x-component'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/javascript'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/json'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/xhtml+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/rss+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/atom+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/vnd.ms-fontobject'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'image/svg+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'image/x-icon'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/x-font-ttf'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'font/opentype'"
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
</IfVersion>
# APACHE < 2.4
<IfVersion < 2.4>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/x-icon
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
</IfVersion>
</IfModule>
</IfModule>
#
#<IfModule !mod_filter.c>
# # Legacy versions of Apache
# AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
# AddOutputFilterByType DEFLATE application/javascript
# AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
# AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
# AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
#</IfModule>
</IfModule>
#################################
# gestion des erreurs 404
# voir http://www.spip.net/fr_article3226.html
# Pour que le serveur http renvoie les erreurs 404 vers SPIP, supprimer le '#'
ErrorDocument 404 /spip.php?page=404
#
###
<IfModule mod_rewrite.c>
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# Determine the RewriteBase automatically and set it as environment variable.
# If you are using Apache aliases to do mass virtual hosting or installed the
# project in a subdirectory, the base path will be prepended to allow proper
# resolution of the index.php file and to redirect to the correct URI. It will
# work in environments without path prefix as well, providing a safe, one-size
# fits all solution. But as you do not need it in this case, you can comment
# the following 2 lines to eliminate the overhead.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
# If the above doesn't work you might need to set the `RewriteBase` directive manually, it should be the
# absolute physical path to the directory that contains this htaccess file.
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
</IfModule>
# V 1.0.2
## bloquer le spam de sites référents
# https://olivier-chauvel.fr/referrer-spam-google-analytics/
# https://github.com/Stevie-Ray/referrer-spam-blocker/blob/master/.htaccess
# https://perishablepress.com/blacklist/ultimate-referrer-blacklist.txt
# SPAM BLOCKER
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*03e\.info.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*66728556\.videos\-for\-your\-business\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*anonymizeme\.pro.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*avtovykup\.kz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*blog2019\.top.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*burger\-tycoon\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*burger\-imperia\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*buttons\-for\-website\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*buttons\-for\-your\-website\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*comp\-pomosch\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*computer\-remont\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*dbutton\.net.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*dev\.borezo\.info.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*dosugrostov\.site.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*elementspluss\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*elvel\.com\.ua.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*fidalsa\.de.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*free\-website\-traffic\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*hard\-porn\.mobi.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*hundejo\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*hvd\-store\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*int\.search\.myway\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*justprofit\.xyz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*kinosed\.net.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*lerporn\.info.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*medicineseasybuy\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*metallo\-konstruktsii\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*mobile\.regionshop\.biz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*muzaporn\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*pizza\-imperia\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*pizza\-tycoon\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*pk\-pomosch\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*pornonik\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*prostitutki\-spb\.spb\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*shnyagi\.net.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*shops\-ru\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*skinali\.photo\-clip\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*sladkoevideo\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*sovetogorod\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*viagra\-soft\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*video\-\-production\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*videos\-for\-your\-business\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*w3data\.co.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*alinabaniecka\.pl.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*marinetraffic\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*rospromtest\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*stavimdveri\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*tsatu\.edu\.ua.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*xn\-\-\-\-\-6kcamwewcd9bayelq\.xn\-\-p1ai.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*xn\-\-\-\-8sblgmbj1a1bk8l\.xn\-\-\-\-161\-4vemb6cjl7anbaea3afninj\.xn\-\-p1ai.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*xn\-\-\-\-ctbigni3aj4h\.xn\-\-p1ai.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*xn\-\-d1abj0abs9d\.in\.ua.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*ya\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*yandex\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*ask\-yug\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*beremenyashka\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*brillianty\.info.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*darkbyte\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*dawlenie\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*documentserver\.net.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*filesdatabase\.net.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*infektsii\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*luckybull\.io.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*modforwot\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*moinozhki\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*mybuh\.kz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*odiabetikah\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*ofermerah\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*officedocuments\.net.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*ogorodnic\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*orenstein\.soef\.net.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*pills24h\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*popugaychiki\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*scat\.porn.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*sinhronperevod\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*slomm\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*spb\-plitka\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*tattoo\-stickers\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*vzheludke\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*vzubkah\.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*ww2awards\.info.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*atyks\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*blog100\.org.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*blog2019\.xyz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*blogseo\.xyz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*dailyseo\.xyz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*ecblog\.xyz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*ecosia\.org.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*galblog\.top.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*hiblog\.top.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*iblogger\.site.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*incomekey\.net.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*kakablog\.net.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*seotalk\.xyz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*urblog\.xyz.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*zapmeta\.fr.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*yhirurga\.ru.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?.*youcare\.world.*$ [NC]
# flags F (forbiden) L (stop propagation)
RewriteRule ^(.*)$ – [F,L]
# SPAM BOTS
# https://pastebin.com/5Hw9KZnW
# Abuse Agent Blocking
RewriteCond %{HTTP_USER_AGENT} crawl [NC,OR]
RewriteCond %{HTTP_USER_AGENT} [Dd]ot[Bb]ot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Exabot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Python-urllib [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Dalvik [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Cliqzbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} SafeDNSBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} SemrushBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ZyBorg [NC]
# flags F (forbiden) L (stop propagation)
RewriteRule ^.* - [F,L]
以上是关于ini htaccess spip的主要内容,如果未能解决你的问题,请参考以下文章
httpd.conf、php.ini 和 .htaccess 之间的区别