I'm having a few problems getting a PHP script to work on a new server - I've gone from apache to a Litespeed server, and I can't get the little CMS to work on it.
In a nutshell the .htaccess contains:
ServerName www.domain.co.uk
ServerAlias domain.co.uk
DocumentRoot /home/domain/public_html/
<Directory /home/ttedomainpublic_html/>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.co.uk [NC]
RewriteRule ^(.*)$ index.php [L]
RewriteRule ^(.*) http://www.domain.co.uk/$1 [L,R=301]
RewriteBase /
RewriteRule ^(admin|content|css|images|img|non_public|pdf|renderers|scripts|sendmail|templates) - [L]
</Directory>
And the index.php contains:
<?php
include("non_public/config.php");
// Get the request URI
$requestUri = $_SERVER['REQUEST_URI'];
$requestUri = preg_replace("~^/~","",$requestUri);
$requestUri = str_replace("/","_",$requestUri);
// Make sure that we'll get the index
if(empty($requestUri)) $requestUri = "index";
if(file_exists(ROOT_PATH . "content/" . $requestUri))
{
// Include the header
include(ROOT_PATH . "templates/header.php");
// Check if there's a renderer
if(file_exists(ROOT_PATH . "renderers/" . $requestUri . ".php"))
{
include(ROOT_PATH . "renderers/" . $requestUri . ".php");
}
else
echo file_get_contents(ROOT_PATH . "content/" . $requestUri);
// Include the footer
include(ROOT_PATH . "templates/footer.php");
}
else
echo file_get_contents(ROOT_PATH . "content/404");
?>
So the above should throw a page together from the content file held in content/, a few bits and bobs from the template and some basic things from the renderers/ directory.
I hope that makes sense so far? This has worked well on an Apache server for a few years, but just doesn't work under Litespeed. The current end result when you go to www.domain.co.uk/notes is simply a 404 page, because obviously www.domain.co.uk/notes/index.php etc. doesn't exist and the server can't seem to put the page together.
Can anyone please point me in the right direction?
Many thanks...