php - How can i redirect users (with mod_rewrite) to 404 page if they type in an existing file, or folder? -
how can redirect users (with mod_rewrite) 404 page if type in existing file, or folder ?
example:
i have 2 files @ site: www.example.com/index.php - homepage www.example.com/about.php - page
i don't want accesible @ index.php , about.php. want way only: www.example.com/ www.example.com/about
and want work way every file create.
just redirect pages want php page sends 404 header.
for instance:
rewriterule pagetoredirect.htm errorpage.php [l]
errorpage.php have whatever in , specify:
header("status: 404 not found");
Comments
Post a Comment