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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -