.htaccess :
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .+ %{DOCUMENT_ROOT}/whereveryouwannakeepthis/404.php [L]
404.php:
Code:
<?php
$uri = $_SERVER['REQUEST_URI'];
$path = parse_url($uri, PHP_URL_PATH);
$filename = basename($path);
if($collection = substr($filename, 0, strpos($filename, ".php")) )
{
$collection = str_replace("-"," ",$collection);
print $collection;
}
else
{
http_response_code(404);
exit;
}
?>