开发者

htaccess // allow only certain file or folder?

I'm currently rebuilding my site and I want to make "under construction" page for visitors during that time.

My only problem is that I want to user pictures whit it but when I have in my htaccess file this:

# Under construction
RewriteCond %{REMOTE_HOST} !^xxx\.xxx\.xxx\.xxx
RewriteCond %{REQUEST_URI} !/rebuilding\.html$
RewriteRule .* http://www.myurl.com/rebuilding.html [R=302,L]

visitors have access only that rebuilding.html file, but no other right? So how开发者_运维技巧 can I manage to solve that? But all files in one folder and redirect all but myself into there? How?

Thanks for all help!


Put the maintenance files in a separate directory and restrict access to files within that directory.


You can allow all media types (css, png, gif, jpg) with yet another rewrite cond. And no matter which folder they are in - they will be loaded.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜