Php 从主机服务器停用页面

Php 从主机服务器停用页面,php,rename,Php,Rename,我想从我的主机停用一个页面。喜欢 www.example.com/page5.php 如果我在浏览器中键入以上链接。它显示我404页或重定向我的主页等 请告诉我怎么做。虽然我不想重命名页面。 谢谢给你: Header(Location: URL); 或: 或: 使用.htaccess RewriteRule ^page5.php$ index.php [R=404,L] 或者在page5.php中 header('HTTP/1.1 404 Not Found'); 或 或 你说的“停用”到

我想从我的主机停用一个页面。喜欢 www.example.com/page5.php 如果我在浏览器中键入以上链接。它显示我404页或重定向我的主页等

请告诉我怎么做。虽然我不想重命名页面。 谢谢

给你:

Header(Location: URL);
或:

或:

使用.htaccess

RewriteRule ^page5.php$ index.php [R=404,L]
或者在page5.php中

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


你说的“停用”到底是什么意思?请添加更多的细节和背景。我使用htaccess,它现在可以工作了,谢谢。
RewriteRule ^page5.php$ index.php [R=404,L]
header('HTTP/1.1 404 Not Found');
header('Location: index.php');
header('Refresh: 2; url=index.php');
print "You are not allowed to access this page.";