After moving a website to a new server running apache 2.4, this website no longer works and gives a 500 server error.
The current .htaccess file is as follows:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?name=$1 [L]
The index.php files handles the urls as follows:
<div role="main">
<?php
// Defualt page will always be home.html
$page = 'home';
// Lets get pages based on user input
if (!empty($_GET['name'])) {
//Assign a variable to a sanitised version of the data passed in the URL
$tmp_page = basename($_GET['name']);
//If the file exists, update $page
if (file_exists("pages/{$tmp_page}.html"))
$page = $tmp_page;
//If the file does not exist, include our custom notfound page and don't run anymore code
elseif(!file_exists($tmp_page)){
include("pages/notfound.html");
exit;
}
}
// Include our default page declared above if no data is passed (no clicks on menu)
include("pages/$page.html");
?>
</div>
I have not been able to fix this by just changing the .htaccess. I'm only hosting the website, so ideally I do not want to make changes to the website without the designer's consent.