我如何 Comprobe 找不到 404?
这是我的代码 php:
$id = $_GET['id'];
$slug = "my-slugified-title-post-in-this-example"; // Slug is dinamic according to id
echo "This post is here!";
这是我的 htaccess
RewriteRule ^posts/([0-9]+)/(.*?).html post.php?id=$1$slug=$2 [L,NC]
如果 url 中的 $slug 错误,我想要 404 错误:
http://mysite.com/posts/274/my-slugified-title-post-wrong-in-this-example.html //slug is wrong
这没关系!
http://mysite.com/posts/274/my-slugified-title-post-in-this-example.html