I am trying to use an htaccess redirect, and for some reason when I try to redirect the user, instead of going to page.html, it tries to go to page.htmlpage.htmlpage.htmlpage.html and it just keeps on repeating it. A开发者_如何学Gonyone have any clue what I am going wrong?
Here is my htaccess file:
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName 2enetwork.x10hosting.com
Options All -Indexes
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 500 /error/500.html
Redirect / http://2enetwork.tk/under_construction.html
#RewriteEngine On
#RewriteRule ^(.*)$ ./under_construction.html [L]
Oh, and also, it will give me a 403 error and underneath that it says and addition 302 error was found. If I comment the Redirect / http://2enetwork.tk/under_construction.html
, it works fine. There is nothing wrong with the site, and I can see the under construction page fine.
Ok, I figured out why. When I sat there and tried to rediret my site, I redirected the whole site to uc.html (under_construction.html), and uc.html is included in the rest of the site, so it would then try to redirect to uc.html again, and again, and again in a never ending loop. So, my new question is, How do I prevent this from happening? Is there a way I can redirect my whole site minus uc.html?
Anything more complex than a brute force "go there" needs mod_rewrite
.
This hasn't been tested, but...
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !under_construction\.html$
RewriteRule ^(.*)$ ./under_construction.html [L]
This RewriteCond line tells it to rewrite all requests except ones for files named under_construction.html*.
* Techinically, all files that end with the string "under_construction.html".
精彩评论