I have written this .htacces file for my upcoming web portal
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
from above if my url is http://localhost/makin/single.php?username=ankit it converts it into http://localhost/makin/ankit that is what i want.
But when i am changing url like localhost/makin/shdfhdhghhdsj it shows the same page instead the username is not correct .or if put any thing like **localhost/makin/ankit***shfhjshdfjh* after username anything it shows same page like what i want is to show the error if someone try to open with fake username.. Please help me out guys with this
Inside your file single.php, check if the value of $_Get["username"] is valid or not. If it is not valid, do a redirect to an "invalid" username "page" else load single.php as usual