Архиви на блога

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource

If you have following error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at Then you need to add some lines to your .htaccess file <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / Header add Access-Control-Allow-Origin „*“ Header

С етикет: , , , ,
Публикувано в Joomla, linux, wordpress

Redirect all php files to wordpress posts or strip .php extension

If you need to redirect your old urls which are like alabala.com/see-this-post.php to alabala.com/see-this-post/ You can use this simple .htaccess redirect RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)\.php$ /$1/ [l,R=301,NC]

С етикет: , , ,
Публикувано в wordpress

catch spam from apache

Sometimes is very hard to debug from which virtual host spam is This can be check very easy with this trick create a new file  vim /usr/local/bin/phpsendmail place inside it #!/usr/bin/php <?php $sendmail = ‘/usr/sbin/sendmail’; $logfile = ‘/var/log/mail.form’; /* Get

С етикет: , , , ,
Публикувано в linux, php

php post with big array

Starting from php 5.3.9 there is brand new config option max_input_vars which is limiting the input variables to posted arrays and etc. max_input_vars integer How many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal

С етикет: , , , ,
Публикувано в linux

mod_evastive

cd /usr/local/src Download the module wget http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz Untar tar zxvf mod_evasive_1.10.1.tar.gz Go to the folder cd mod_evasive Compile it /usr/sbin/apxs -cia mod_evasive20.c Add to apache config file /etc/httpd/conf/httpd.conf <IfModule mod_evasive20.c> DOSHashTableSize 3097 DOSPageCount 6 DOSSiteCount 100 DOSPageInterval 2 DOSSiteInterval 2

С етикет: , , , ,
Публикувано в linux