I don't know how to use cURL with Cookies yet, but you could put (in the add-on domain directory):
PHP Code:
<?php
$requested_url = $_SERVER['REQUEST_URI'];
$postedvars = count($_POST);
if($postedvars!=0){
$curlPost = '';
foreach($_POST as $key=>$val){
$curlPost.= $key.'='.urlencode($val).'&';
}
$curlPost = substr($curlPost,0,-1);
}
$ch = curl_init();
$curltimeout = 5;
curl_setopt($ch, CURLOPT_URL, "http://yourmaindomain.com".$requested_url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $curltimeout);
if($postedvars!=0){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
}
$data = curl_exec($ch);
curl_close($ch);
echo $data;
?>
and put:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.php [L]
in the .htaccess in the directory.