| 11:14 pm on Nov 3, 2013 (gmt 0)|
oops...sticky fingers on the "mm". I basically want to take a folder of my site offline until I'm able to fix things.
| 2:07 am on Nov 4, 2013 (gmt 0)|
:: insert boilerplate about Why We Make You Do It Yourself ::
Oh, never mind, you've been around since 2002:
BEFORE your existing RewriteRule:
RewriteRule ^special http://www.example.com/message.html [R=302,L]
Here the R=302 is just a formality, since 302 (temporary) is the default value of [R], and the protocol-plus-domain makes your rewrite into a redirect regardless. But let's be precise about it.
That's assuming for the sake of discussion that you don't have a /dirname1/ or /dirnameblahblah/ that doesn't need redirecting. If you do, fine-tune the condition to
Otherwise you don't need a closing anchor, since you're not capturing. But as long as we're here: the optimal domain-name-canonicalization rule has a single condition that looks like this
"exactly www.example.com or exactly nothing". That will also get rid of any incoming requests with appended port number.
Psst! I don't know exactly how long the post-editing cutoff is, but I'm sure it's more than two minutes ;)
| 2:21 am on Nov 4, 2013 (gmt 0)|
Thanks Lucy. I actually figured it out myself after many Google searches and testing. Panic adds that little bit of pressure to keep trying. :)
I put the code below in the folder's .htaccess file that I wanted to redirect. All pages return a 302 and my message page.
RewriteRule ^.*$ /message.html [R=302,L]
| 4:03 am on Nov 4, 2013 (gmt 0)|
|I basically want to take a folder of my site offline until I'm able to fix things. |
what you probably want is a 503 Unavailable response with a custom 503 error page specified for that directory that contains the message.html content.
| 2:49 pm on Nov 4, 2013 (gmt 0)|
Thank you prhanque. That probably would have been a better solution. The problem was taken care of within a few hours. Hopefully, there won't be any fallout.
| 10:05 pm on Nov 4, 2013 (gmt 0)|
the difference to a human visitor is almost zero.
if you were crawled during that time, you may find your /message.html content indexed for any pages that were crawled in that directory until they get recrawled and reindexed.
a 503 response avoids getting your "offline" message indexed.
| 10:25 pm on Nov 4, 2013 (gmt 0)|
|you may find your /message.html content indexed for any pages that were crawled in that directory until they get recrawled and reindexed. |
I thought the difference between 301 and 302 was that 302 content doesn't get indexed at the old URL. No longer true? Or have I got it backward? Wouldn't be the first time :(