htaccess,将所有请求重定向到splash.php

时间:2012-11-28 18:11:13

标签: php apache .htaccess redirect

我需要为网站重新启动设置一个启动页面。所有请求都需要重定向到splash.php ...但此文件需要访问包含启动页面中使用的图像的/splash目录。

我不确定htaccess中的确切规则是什么... ...如果所有请求都被路由到/splash并且实际的启动页面是索引会更好吗?

2 个答案:

答案 0 :(得分:0)

我在SO上找到了一个很棒的剧本:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !=123.45.67.89
RewriteRule index.php$ /splash.php [R=301,L]

答案 1 :(得分:0)

的内容
RewriteEngine On
RewriteCond %{REQUEST_URI}  !(image\.png)$
RewriteRule (.*)  /splash.html [QSA]

至少应该给你一个起点......