Table of Contents

Hints

PHP Includes

Some people include files like

include('http://otherdomain/1.html');

or

virtual('/scj/top/top.html');

or

readfile('http://domsin/1.html')

moreover they use it may times per page.

You should NOT use it.

Why:

PHP creates page BEFORE user gets it. So if you have something like include('http://otherdomain/1.html') PHP has to load that page each time user load a page with that include.

There 2 downsides of this approach:

What to do:

Use only local includes. Ie virtual('/scj/top/top.html') should be include('/home/user/domain/scj/top/top.html');

if file is located at another server - ask admin to setup rsync or copy file using crontab and so on.

Including local script with parameters

Let's say you have include like

<?php
include('http://domain.com/banner.php?x=3&y=2');
?>

so you have some parameters here. You can pass it as

<?php
$_GET['x'] = 3;
$_GET['y'] = 2;
include('banner.php');
?>

Close site for some countries

Example for .htaccess

RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(RU|CN)$ [NC] 
RewriteRule ^$ http://google.com [R,L]