简体   繁体   English

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

[英]htaccess, redirect all requests to splash.php

I need to put up a splash page for a site relaunch.我需要为网站重新启动设置一个启动页面。 All requests need to redirect to splash.php ... but this file needs access to the the /splash directory which contains an image used within the splash page.所有请求都需要重定向到splash.php ... 但该文件需要访问/splash目录,该目录包含在启动页面中使用的图像。

I'm not sure what the exact rules need to be within htaccess ... also, would it be better if all requests were routed to /splash and the actual splash page was an index?我不确定htaccess需要的确切规则是什么……另外,如果所有请求都路由到/splash并且实际的启动页面是索引会更好吗?

I found a great script here on SO:我在这里找到了一个很棒的脚本:

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

Something along the lines of类似的东西

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

Should at least give you a starting point...至少应该给你一个起点......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM