5

我正在使一个站点永久脱机,但在它关闭之前我会在其上显示一个启动页面一两个星期。如何编辑我的 .htaccess 文件以显示该启动页面?它需要允许页面本身(根目录)以及 /images 目录中的两个图像。

4

1 回答 1

20

将以下配置放入.htaccess网站根目录中:

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/splash.html$
RewriteCond %{REQUEST_URI} !^/images/usedimage.png$
RewriteCond %{REQUEST_URI} !^/images/anotherusedimage.png$
RewriteRule .* /splash.html [R=301,L]
于 2012-11-18T18:42:34.940 回答