[英]Redirect Site Wide, Exclude Page
I need to redirect all pages on my website to another page: 我需要将网站上的所有页面重定向到另一个页面:
harryfelton.host56.com -> harryfelton.host56.com/webisteDown.php harryfelton.host56.com-> harryfelton.host56.com/webisteDown.php
The thing is that either it doesnt redirect or it redirects the output page and causes a loop, I want to be able to put that in the .htaccess file and have any page on the website redirect to the websiteDown.php... Another problem I got was that there was no css styling on the page after redirect, Even though it is there if I go there myself, is is the extra '/' I think it is because if I add that it looses styles, But anyway, Anyone know how to do the redirecting? 问题是它要么不重定向,要么重定向输出页面并导致循环,我希望能够将其放在.htaccess文件中,并使网站上的任何页面都重定向到websiteDown.php ...另一个问题我得到的是重定向后页面上没有css样式,即使我自己去那里也存在,还是多余的“ /”,我想是因为如果我添加它会松动样式,但是无论如何,任何人知道如何进行重定向?
You can use this rule in root .htaccess: 您可以在根.htaccess中使用此规则:
RewriteEngine On
RewriteRule !^(webisteDown\.php|.+?\.(?:jpe?g|gif|bmp|png|tiff|css|js))$ webisteDown.php [L,NC,R]
This rule redirects to /webisteDown.php
if request is not for webisteDown.php
OR any css, js, images files. 如果请求不是针对
webisteDown.php
或任何CSS,JS,图像文件的,则此规则将重定向到/webisteDown.php
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.