htaccess文件出错


error in .htaccess file

我已经为我即将到来的web门户编写了这个。htacces文件

Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteRule ^about-us about-us.php
RewriteRule ^blog blog.php
ErrorDocument 400 /errors/badrequest.html
RewriteRule ^blogs/([^/'.]+)/?$ post.php?blogname=$1 [L,NC,QSA]
RewriteRule ^([a-zA-Z0-9_-]+)$ single.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ single.php?username=$1

从上面如果我的url是http://localhost/makin/single.php?username=ankit它把它转换成http://localhost/makin/ankit,这就是我想要的。

但是当我改变url像localhost/makin/shdfhdhghhdsj它显示相同的页面,而不是用户名不正确。或者如果把任何东西像**localhost/makin/ankit***shfhjshdfjh*在用户名之后,它显示相同的页面,就像我想要的是显示错误,如果有人试图用假用户名打开。请大家帮帮我吧

在single.php文件中,检查$_Get["username"]的值是否有效。如果无效,重定向到"无效"用户名"页面",否则像往常一样加载single.php