I see the post validating utf-8 in htaccess rewrite rule and I think that is great, but a more fundamental problem I am having first:
I needed to expand to handle utf-
This solution is based on: http://www.dracos.co.uk/code/apache-rewrite-problem/
Try this rewrite rules:
AddDefaultCharset UTF-8
RewriteEngine On
RewriteCond %{THE_REQUEST} /puzzle/([^?\ /]+)
RewriteRule ^puzzle/(.*)$ puzzle.php/%1 [L]
How to get the query param:
g: $g";
// Test if '/' is present in URL for 404's
$g2 = substr($_SERVER['REQUEST_URI'], 8);
if (strpos($g2, '/') === false) {
// do stuff
} else {
// Send 404 header here
echo "404
";
}
?>
With this solution you have to send the 404 from php.