2
Hi,
Quote:
vinit wrote:
just got few queries about the usage of .htaccess and errormessages.
1. Where do i put .htaccess file in root directory / or anywhere.
In the 'web root' path, which is usually of the format /home/username/public_html
Quote:
vinit wrote:
2. i have multiple sites hosted from same server spaces.
example
/foo ->http://www.foo.com
/bar ->http://www.bar.com
now i want to so different custom error msgs for both the directories is it possible.
Maybe something like this in PHP
// If user comes to site with preceeding string "www." , remove it, not required
$httphostname = $_SERVER['HTTP_HOST'];
$hostname = str_replace("www.", "", $httphostname);
$error_messages = array(
'foo.com' => 'Error message for foo.com site',
'bar.com' => 'Error message for bar.com site'
);
if (isset($error_messages[$hostname])) $errmsg = $error_messages[$hostname];
else $errmsg = 'No error message set';
?>
Quote:
vinit wrote:
3. What should be the permision of .htaccess file and also the error files.
Usually a 644 for .htacess, and also for the PHP script (error file)
Peter