从主机服务器停用页面[关闭]

I want to deactivate a page from my hosting. like www. example.com/page5.php If i type above link in browser. It shows me 404 page or redirect me on main page etc.

How to do this please guid me. while i don't want to rename the page. Thanks

With .htaccess

RewriteRule ^page5.php$ index.php [R=404,L]

or in page5.php

header('HTTP/1.1 404 Not Found');

or

header('Location: index.php');

or

header('Refresh: 2; url=index.php');
print "You are not allowed to access this page.";

Here you go:

Header(Location: URL);

Or:

die("You cant acces this page");

Or:

header('HTTP/1.1 404 Not Found');
exit;