|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Time Direction with htaccess
Basically I'm trying to forward my site visitors to a maintenance page between 4am and 6am. I've added the lines below to .htaccess but it doesn't work. Any suggestions?
RewriteEngine on RewriteBase /~quux/ RewriteCond %{TIME_HOUR}%{TIME_MIN} >0400 RewriteCond %{TIME_HOUR}%{TIME_MIN} <0600 RewriteRule ^/~(.+) maintenance.html |
|
#2
|
|||
|
|||
|
Are you sure you need to use RewriteBase?
What's the full system path to your docroot? And your maintenance.html in full system path and URL path. |
|
#3
|
|||
|
|||
|
Is that what I am missing? Should I put the full path in?
|
|
#4
|
|||
|
|||
|
No, you tell us those as they are somewhat important to configure your Rewrite rulesets.
|
|
#5
|
|||
|
|||
|
Full path would be:
/home/www/*username*/*domain name*/public_html |
|
#6
|
|||
|
|||
|
How about maintenance.html (full path and URI)?
|
|
#7
|
|||
|
|||
|
It's in the public_html folder.
|
|
#8
|
|||
|
|||
|
This is the 3rd and last time, I need to know the FULL URL to maintenance.html.
|
|
#9
|
|||
|
|||
|
Sorry, thought it was clear.
/home/www/*username*/*domain name*/public_html/maintenance.html |
|
#10
|
|||
|
|||
|
I said URL and full system path. You already provided the full system path but need to know the URL. When your root URI is not under your domain it makes huge difference.
A UserDir account for example, its root URI is http://www.domain.com/~username/ instead of http://www.domain.com/ |
|
#11
|
|||
|
|||
|
Sorry, you know much more than I do.
The path is http://www.domain.com/maintenance.html ~username is not needed. |
|
#12
|
|||
|
|||
|
Then just this:
RewriteEngine on RewriteCond %{TIME_HOUR}%{TIME_MIN} >0400 RewriteCond %{TIME_HOUR}%{TIME_MIN} <0600 RewriteRule ^(.*) /home/www/username/domainname/public_html/maintenance.html [L] |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Time Direction with htaccess |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|