Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I'm going to be upgrading a website and was hoping to allow 1 IP address to view it during the upgrade process (mine), and any other IP except mine to redirect to another page.
This is not going to work. The regex \.html$ means everthing that ends in .html, so in your case when other people visit a html page they will be redirected to alternate_page.html, that also ends in .html, so you'll have a loop. Besides that everyone can see other stuff like images, php files etc.
You should use something like that:
Yes is is. My site is in PHP the IP block works but when I view it I see the website plus the upgrade.html embeded either behind my site or showing as part of the site. How can I fix that?
Still don't get it.
upgrade.html is under the document root of your site, so it's normal to see it, if you request it.
If you don't want the page to be under your document root, you can redirect the users to a vhost, or something like that. In that case you don't the 2nd line and the last line should be:
It looks like for me also is too difficult to understand
Anyway, are these screenshots from your browser?
I guess that the 1st image is the upgrade page shown twice plus the index in the back and the 2nd is your site new index page
Could be a browser cache or else I cannot understand how this can happen
Well, unless you have coded upgrade.html in such a way to show all this.
What happens if you visit directly upgrade.html?
My fault. It's not the upgrade.html that you have to look, but the index page.
You should also try to visit the faulty page directly and see what you get
I think that maybe I can see what happens:
From the upgrade.html, I see that you're using external http requests for the images in your page, so you get redirected to upgrade html
Try adding as another RewriteCond (changing domain.com accordingly):
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.