.htaccess 正在施工的dosen'页;t加载-302从htacces重定向

.htaccess 正在施工的dosen'页;t加载-302从htacces重定向,.htaccess,redirect,using,.htaccess,Redirect,Using,我想把我所有的流量重定向到一个“正在建设”(即将推出)的页面,但是页面样式没有加载。我想我需要将所有流量重定向到/正在构建/文件夹,但如果我尝试,我会收到一个循环重定向错误(重定向太多) 我使用这个重写代码使用.htaccess重定向除我的ip之外的所有流量 重新编写引擎打开 重写基/ 重写cond%{REMOTE_HOST}^5.xx.xxx.xx 重写cond%{REQUEST_URI}/正在构建/索引\.html$ 重写规则。*http://gopal.net.cn/under-const

我想把我所有的流量重定向到一个“正在建设”(即将推出)的页面,但是页面样式没有加载。我想我需要将所有流量重定向到/正在构建/文件夹,但如果我尝试,我会收到一个循环重定向错误(重定向太多)

我使用这个重写代码使用.htaccess重定向除我的ip之外的所有流量

重新编写引擎打开
重写基/
重写cond%{REMOTE_HOST}^5.xx.xxx.xx
重写cond%{REQUEST_URI}/正在构建/索引\.html$
重写规则。*http://gopal.net.cn/under-construction/index.html [R=302,L]


我需要做什么才能工作?

您可能只想重定向HTML页面,而不是图像和css。然后用这个:

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^5.xx.xxx.xx
RewriteCond %{REQUEST_URI} !/under-construction/index\.html$
RewriteRule (.*)\.html$ http://gopal.net.cn/under-construction/index.html [R=302,L]
这就是解决办法:

    # MAINTENANCE-PAGE REDIRECT
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REMOTE_ADDR} !^5.x.xxx.xxx
 RewriteCond %{REQUEST_URI} !/under-construction/index.html$ [NC]
 RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|css|php|js) [NC]
 RewriteRule .* /under-construction/index.html [R=302,L]
</IfModule>
#维护页面重定向
重新启动发动机
重写cond%{REMOTE_ADDR}^5.x.xxx.xxx
重写cond%{REQUEST_URI}/正在构建/index.html$[NC]
重写条件%{REQUEST\u URI}!\。(jpe?g?| png | gif | css | php | js)[NC]
重写规则。*/under construction/index.html[R=302,L]

需要此代码行
RewriteCond%{REQUEST\u URI}!\。(jpe?g?| png | gif | css | php | js)[NC]
。没有它,js、php、css就无法加载。

你的日志怎么说?你说页面的样式无法加载。这是否意味着您的HTML文件本身不会加载?页面需要看起来像照片1,现在看起来像照片2。照片2我使用这个,如果我直接访问页面URL,页面将正确加载,但现在没有从主页重定向到正在构建的页面:(主页的URL是什么?