skip to Main Content

we’ve recently done an manual internal server migration and as we’re moving over our client websites, some of our static websites are having issues with their folder structure?

This is an example of a website having issues – as you can see, it’s picking up the CDN folder as:

/CDNcss/bootstrap.min.css 

but the initial CDN folder is actually lowercase and ofcourse the slash is missing – now this on the surface could be sorted by altering the containing cdn folder structure and adding a slash, but it is clearly an issue regarding the initial file setup as the statement is just being picked up as /BaseUrl

now in /includes there’s a file called settings.php that presents the following code:

<?php

date_default_timezone_set('Europe/London');
ini_set('display_errors',1);
error_reporting(0);

define("MODULEPATH", $_SERVER['DOCUMENT_ROOT']);
define("CDN", 'http://splintaofficial.co.uk/cdn/');
define("BaseUrl", 'http://splintaofficial.co.uk/');

$DynamicMeta = 1;
$RequestUri = $_SERVER["REQUEST_URI"];
$RequestUrl = explode("/", $RequestUri);
$ScriptName = $_SERVER["SCRIPT_NAME"];

?>

but this script was working perfectly on our old server? We’ve even downgraded the PHP for this particular client webspace back to 5.5 to test if it was anything with php7/7.1 – but it doesn’t seem it is? Can anyone give any advice on why this is happening?

For note, the header file prints the following (incase the syntax has changed or something!? Which I wouldn’t imagine as we’ve not changed anything during the migration….)

<link href="<?=CDN?>css/stylesheet.min.css" rel="stylesheet">

The error_log presents the following error:

[Mon Jan 16 10:24:30.935391 2017] [autoindex:error] [pid 31974:tid 139637574072064] [client 54.226.66.8:33364] AH01276: Cannot serve directory /var/www/vhosts/splintaofficial.co.uk/httpdocs/cdn/: No matching DirectoryIndex (index.html,index.shtml,index.cfm,index.php,index.htm,index.php) found, and server-generated directory index forbidden by Options directive

There’s also a working htaccess which allows serving of content from subdomains etc, feel free to check that out also, if I need to post this, let me know.

2

Answers


  1. This error:

    [Mon Jan 16 10:24:30.935391 2017] [autoindex:error] [pid 31974:tid 139637574072064] [client 54.226.66.8:33364] AH01276: Cannot serve directory /var/www/vhosts/splintaofficial.co.uk/httpdocs/cdn/: No matching DirectoryIndex (index.html,index.shtml,index.cfm,index.php,index.htm,index.php) found, and server-generated directory index forbidden by Options directive
    

    means that there was incoming request http://splintaofficial.co.uk/httpdocs/cdn/ (pay attention thant there is no file name) but there no any of index files in directory /var/www/vhosts/splintaofficial.co.uk/httpdocs/cdn/

    So error message does not looks related to <link href="<?=CDN?>css/stylesheet.min.css" rel="stylesheet"> or this template was not rendered.

    Login or Signup to reply.
  2. It seems that the code: css/stylesheet.min.css” rel=”stylesheet”> is not working. It seems that the value of the CDN constant is not being displayed.

    You can try to correct this by enabling short open tags in your php.ini file and restart your web server. Or you can use instead of

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search