Задача: заблокировать запросы по маске `glitter_calendar` средсвами apache.
В .htaccess
был кусок от wordpress, потом добавил блокировку к xmlrpc.php, и теперь пытаюсь заблокировать запросы по маске `glitter_calendar`:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{THE_REQUEST} ^.*(wpdffcontent)|(glitter_calendar)|(mp4:).* [NC]
RewriteRule ^(.*)$ - [F,L]
</IfModule>
# END WordPress
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
</Files>
Тут и на stackoverflow нашел похожие вопросы.
Оно не работает. Error 404 Not Found выдается внутри страницы с wordpress.
Правило блокировки xmlrpc.php работает.
Модуль включен:
# httpd -M
...
Loaded Modules:
...
rewrite_module (shared)
...
И все это крутится на virtual host, который управляется virtualmin.
Кусок httpd.conf файла apache:
...
LoadModule rewrite_module modules/mod_rewrite.so
...
<VirtualHost x.x.x.x]:80>
SuexecUserGroup "#505" "#504"
ServerName mysite.com
ServerAlias www.mysite.com
ServerAlias webmail.mysite.com
ServerAlias admin.mysite.com
ServerAlias autoconfig.mysite.com
ServerAlias autodiscover.mysite.com
DocumentRoot /home/mysite/public_html
ErrorLog /var/log/virtualmin/mysite.com_error_log
CustomLog /var/log/virtualmin/mysite.com_access_log combined
ScriptAlias /cgi-bin/ /home/mysite/cgi-bin/
ScriptAlias /awstats/ /home/mysite/cgi-bin/
ScriptAlias /AutoDiscover/AutoDiscover.xml /home/mysite/cgi-bin/autoconfig.cgi
ScriptAlias /Autodiscover/Autodiscover.xml /home/mysite/cgi-bin/autoconfig.cgi
ScriptAlias /autodiscover/autodiscover.xml /home/mysite/cgi-bin/autoconfig.cgi
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/mysite/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/mysite/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/mysite/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/mysite/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.mysite.com
RewriteRule ^(.*) https://mysite.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.mysite.com
RewriteRule ^(.*) https://mysite.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
FcgidMaxRequestLen 1073741824
Alias /dav /home/mysite/public_html
Alias /pipermail /var/lib/mailman/archives/public
<Location /dav>
DAV on
AuthType Basic
AuthName "mysite.com"
AuthUserFile /home/mysite/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php5
RewriteEngine off
</Location>
<Files awstats.pl>
AuthName "mysite.com statistics"
AuthType Basic
AuthUserFile /home/mysite/.awstats-htpasswd
require valid-user
</Files>
RedirectMatch /cgi-bin/mailman/([^/\.]*)(.cgi)?(.*) https://mysite.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
RedirectMatch /mailman/([^/\.]*)(.cgi)?(.*) https://mysite.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
php_value memory_limit 32M
IPCCommTimeout 41
Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
Redirect /.well-known/autoconfig/mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
</VirtualHost>
Как починить? Спасибо.