Forum Moderators: phranque
# Rule 3
# Redirect to HTTP for non-secure pages
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteCond %{REQUEST_URI} ^/index.html$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/afa/index.html$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/pf1/index.html$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/pf2/index.html$ [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301]
^((?:one|two|three)/)?index\.html Rule 4 is the problem area. I wish to rewrite
RewriteCond %{HTTP_USER_AGENT} ^(.*)Baiduspider(.*) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)YandexBot(.*) [NC]
RewriteRule ^(.*)$ - [F,R=403,L]
octuplicate contentI don't understand.
^((?:one|two|three)/)?index\.htmlI don't understand "?:" in this context. Does the following rewrite condition do what you suggest:
Never ever use [NC] in a rule that ends in [L] aloneIf the the request in the first RewriteRule of Rule 4 had been for /ALS, would this be rewritten to /afa as required?
The wording of #4 makes me uneasy, because it's actually three rules.I did at one stage try it as three separate rules, and that didn't work any better. But looking back over that stage of this development, I don't think I had the escapes correct.
On the plus side, the quoted rules seem to be in the right order. Are there more that you didn't quote?No, there are no more rules. At least I did something right!
[edited by: phranque at 9:09 am (utc) on May 9, 2014]
[edit reason] unlinked urls/disabled graphic smileys [/edit]
# RewriteCond %{REQUEST_URI} ^((?:one|two|three)/)?index\.html [NC]
RewriteCond %{REQUEST_URI} ^/((?|afa|pf[12])/)?(index\.html)? [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^((?|afa|pf[12])/)?(index\.html)?$ http://%{HTTP_HOST}/$1 [R=301,L,NC] If the the request in the first RewriteRule of Rule 4 had been for /ALS, would this be rewritten to /afa as required?
However, the conditions requiring Rules 3 and 4 can both occur at once, so even after Rule 3 is completed, I wish for Rule 4 to be checked. I thought having an [L] flag after Rule 3 would preclude Rule 4 being encountered if the rewriting event in Rule 3 was successful. I gather this understanding is not correct; can you please explain further?
.*Baiduspider.*
RewriteRule ^robots\.txt - [L] RewriteCond %{HTTP_USER_AGENT} .*Baiduspider.* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} .*YandexBot.* [NC]
RewriteRule ^(.*)$ - [F]
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^newexample\.com$ [NC]
RewriteRule ^(.*)$ http://newexample.com/$1 [R=301]
# baidu and yandex requests or spoofs get a 403 Forbidden
RewriteCond %{HTTP_USER_AGENT} (Baiduspider|YandexBot) [NC]
RewriteRule . - [F]
# hostname canonicalization (use non-www)
RewriteCond %{HTTP_HOST} !^(example\.com)?$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
Options +FollowSymlinks
Options -Indexes
<Files "robots.txt">
Order Allow,Deny
Allow from all
</Files>
<FilesMatch \.[Hh][Tt][AaPpGg].+$">
Order Allow,Deny
Deny from all
</FilesMatch>
Addhandler application/x-httpd-php5 .html .php
RewriteEngine on
RewriteBase /
# Rule 1
# Block useless bots
RewriteCond %{HTTP_USER_AGENT} (Baiduspider|YandexBot) [NC]
RewriteRule . - [F]
# Rule 2
RewriteCond %{HTTP_HOST} !^(newexample\.com)?$ [NC]
RewriteRule ^(.*)$ http://newexample.com/$1 [R=301,L]
# Rule 3
# Rewrite to HTTP for non-secure pages
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?|afa|pf[12])/)?(index\.html)?$ http://%{HTTP_HOST}/$1$2 [NC,R=301,L]
# Rule 4
# Rewrite those seeking 'als' to 'afa' and 'sf1' to 'pf1' and 'sf2' to 'pf2' and 'sfa' to 'pf2'
RewriteRule /als(.*)$ /afa$1 [L]
RewriteRule /sf([1-2])(.*)$ /pf$1$2 [L]
RewriteRule /sfa(.*)$ /pf2$1 [L]
http://newexample.com/sfa delivers RewriteRule /sfa(.*)$ http://%{HTTP_HOST}/pf2$1 [L] But more importantly, what's %{HTTP_HOST} ? In the end, isn't there just one hostname?Over a transition period, there are old and new domain names pointing to the one dedicated IP address and the files there. I have referred to them as "oldexample.com" and "newexample.com". I want content to always be served with "newexample.com" as the host. Note that the "www.oldexample.com" host was not rewritten in the example I gave (second paragraph above) with the "This Connection is Untrusted ..." result when the prefix was "https://...".
A complicating issue is that redirects specified in my .htaccess file seem to be inherited into cPanel after a time, and I don't know at what level the cPanel redirects are called, or whether having redirects in two places is a problem.When I first raised this post I mentioned the possible complicating issue of the rewrites in my .htaccess file appearing in cPanel as Domain Redirects. I don't understand why parts of my .htaccess file need to be duplicated there, or whether the duplication causes any problems. Can you comment?
Right now it's a bit of a tangle. It may help to backtrack and explain in English what the #3 plus #4 package is intended to do. Then we can work out which rule goes where, and how they should all be worded.Both a tangle and incorrect functioning in that Rule 4 seems not to be encountered. I have tried to explain the need for both rules to operate. I hope you can help further ...
<FilesMatch \.[Hh][Tt][AaPpGg].+$">
Order Allow,Deny
Deny from all
</FilesMatch>
RewriteRule ^((?|afa|pf[12])/)?(index\.html)?$
I want content to always be served with "newexample.com" as the host.
My reason for Rule 3 was to avoid non-secure pages being served as...
So it seems that Rule 4 is not being encountered at all
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?:afa|pf[12])/)?(index\.html)?$ http://www.example.com/$1 [NC,R=301,L]
Rewrite those seeking 'als' to 'afa' and 'sf1' to 'pf1' and 'sf2' to 'pf2' and 'sfa' to 'pf2'
However, a request for http://newexample.com/sfa delivers
"404 Not Found: The requested URL /sfa was not found on this server." The same occurs even if the last rule is modified to:RewriteRule /sfa(.*)$ http://%{HTTP_HOST}/pf2$1 [L]
RewriteRule sfa(.*)$ /pf2$1 [L]
I skipped this one before. Why is it so complicated? All you actually need is <FilesMatch "^\.ht">The version I had was a direct copy from Jim, but I take your point, Lucy, that your form is more compact, and the belt-and-braces approach is redundant anyway, so it's gone.
What I originally suggested was ^((?:afa|pf[12])/)?index\.htmlI didn't understand "?:" in this context, and queried it at the time. Thanks for the explanation. As well as not being captured, does it also mean that "" (nothing), "als", "pf1", and "pf2" are the alternatives?
Are you absolutely positive Rule 4 wasn't supposed to be a redirect?No, I'm not sure. The site is to advertise to our customers, who are volunteers, the First Aid courses run by a volunteer team, of which I am one. In this field courses change name sometimes. For instance, "als" = "Advanced Life Support" used to have a page of its own, but has been replaced by "Advanced Resuscitation" and "Pain Management" which are addressed on the "afa" = "Advanced First Aid" page.
It is also possible that you've mixed up the "pattern" and "target" sides of a rewrite.I don't think that's the case here.
Options +FollowSymlinks
Options -Indexes
<Files "robots.txt">
Order Allow,Deny
Allow from all
</Files>
Addhandler application/x-httpd-php5 .html .php
RewriteEngine on
RewriteBase /
# Rule 1
# Block useless bots
RewriteCond %{HTTP_USER_AGENT} (Baiduspider|YandexBot) [NC]
RewriteRule . - [F]
# Rule 2
RewriteCond %{HTTP_HOST} !^(newexample\.com)?$ [NC]
RewriteRule ^(.*)$ [newexample.com...] [R=301,L]
# Rule 3
# Rewrite to HTTP for non-secure pages
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?:afa|pf[12])/)?(index\.html|page1\.html|page2\.html)?$ [newexample.com...] [NC,R=301,L]
# Rule 4
# Rewrite those seeking 'als' to 'afa' and 'sf1' to 'pf1' and 'sf2' to 'pf2' and 'sfa' to 'pf2'
RewriteRule als(.*)$ /afa$1 [L]
RewriteRule sf([1-2])(.*)$ /pf$1$2 [L]
RewriteRule sfa(.*)$ /pf2$1 [L]
# Rule 3
# Rewrite to HTTP for non-secure pages
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?:afa|pf[12])/)?((?:index|page1|page2)\.html)?$ [newexample.com...] [NC,R=301,L]
The site is to advertise to our customers, who are volunteers, the First Aid courses run by a volunteer team, of which I am one. In this field courses change name sometimes. For instance, "als" = "Advanced Life Support" used to have a page of its own, but has been replaced by "Advanced Resuscitation" and "Pain Management" which are addressed on the "afa" = "Advanced First Aid" page.
So Rule 4 is to rewrite or redirect requests for the old pages to the new pages
RewriteRule ^als(.*)$ http://www.example.com/afa$1 [R=301,L]
RewriteRule ^sf([12].*)$ http://www.example.com/pf$1 [R=301,L]
RewriteRule ^sfa(.*)$ http://www.example.com/pf2$1 [R=301,L]
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?:open|public|insecure).*)?$ http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:closed|private|secure).+)$ https://www.example.com/$1 [R=301,L]
Options +FollowSymlinksI have tried to accommodate the circumstances of having files in the subdirectories, "page[1234]", other than "index.html", and having bookmarks appended. Also, please read "example.com" as being the new domain I referred to as "newexample.com" previously.
Options -Indexes
<Files "robots.txt">
Order Allow,Deny
Allow from all
</Files>
Addhandler application/x-httpd-php5 .html .php
RewriteEngine on
RewriteBase /
# Rule 1
# Block useless bots
RewriteCond %{HTTP_USER_AGENT} (Baiduspider|YandexBot) [NC]
RewriteRule . - [F]
# Rule 2
RewriteCond %{HTTP_HOST} !^(example\.com)?$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
# Former Rule 4
# Rewrite those seeking 'als' to 'afa', 'bookings1 to bookings2', 'sf1' to 'pf1', 'sf2' to 'pf2', and 'sfa' to 'pf2'
RewriteRule ^als(.*)$ http://example.com/afa$1 [R=301,L]
RewriteRule ^bookings1(.*)$ [example.com...] [R=301,L]
RewriteRule ^sf([12].*)$ http://example.com/pf$1 [R=301,L]
RewriteRule ^sfa(.*)$ http://example.com/pf2$1 [R=301,L]
# Former Rule 3
# Rewrite to HTTP for non-secure pages
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?:afa|pf[12])/)?((?:index|page[12])\.html)?(.*)$ http://example.com/$1$2$3 [R=301,L]
# New Rule 5
# Rewrite to HTTPS for secure pages
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:bookings2|private)(?:/)?)((?:index|page[34])\.html)?(.*)$ [example.com...] [R=301,L]
https is forced by having separate .htaccess files in the subdirectories concerned
I find that requests for "https://www.oldexample.com" yield "This Connection is Untrusted ...", ... , but the other permutations of "www." or not, and "oldexample" versus "newexample" are rewritten successfully.I don't understand why this one case misses out on redirection. This issue occurs when only Rules 1 and 2 are active.
RewriteRule ^bookings1(.*)$ [example.com...] [R=301,L]to rewrite the page for online bookings (a publicly-accessible secure area), and in "New Rule 5" I have tried to interpret your suggestion for the case of the new subdirectory name "bookings2" having files within it called "page3.html" and "page4.html". I used your
and converselyand
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:closed|private|secure).+)$ [example.com...] [R=301,L]
RewriteRule ^((?|afa|pf[12])/)?(index\.html)?$Some of these files have anchors which I wish to preserve in the rewriting process. (I wrongly referred to the "anchors" - like "index.html#Fees" - as "bookmarks" earlier.)
# New Rule 5covering the tops of the two secure hierarchies, "bookings2" and "private", and the files within, "page3.html", "page4.html", as well as "index.html", and anchors.
# Rewrite to HTTPS for secure pages
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:bookings2|private)(?:/)?)((?:index|page[34])\.html)?(.*)$ [example.com...] [R=301,L]
RewriteEngine onand at the top of the team-secure area, "private", I have a .htaccess file with access-control as well as the above. Perhaps this is not the correct way to do things, but they have worked well since 2009. From reading as much as I could, it seemed this was the way to set https=on for the directories and files further down the hierarchy.
SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "example.com"
ErrorDocument 403 [example.com...]
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^.*$ [%{SERVER_NAME}%{REQUEST_URI}...] [R,QSA,L]
Some of these files have anchors which I wish to preserve in the rewriting process. (I wrongly referred to the "anchors" - like "index.html#Fees" - as "bookmarks" earlier.)
/page2/access.php?access_file=consentI am trying also to capture these and pass them to the target.
What about requests for downloads, such as:/page2/access.php?access_file=consent
# Former Rule 4Most redirection, and even the passing of #... and query strings, seem to work as intended. However, links to the home page do not, instead producing the error message:
# Rewrite those seeking 'als' to 'afa', 'bookings1' to 'bookings2', 'sf1' to 'pf1', 'sf2' to 'pf2', and 'sfa' to 'pf2'
RewriteRule ^als(.*)$ http://example.com/afa$1 [R=301,L]
RewriteRule ^bookings1(.*)$ [example.com...] [R=301,L]
RewriteRule ^sf([12].*)$ http://example.com/pf$1 [R=301,L]
RewriteRule ^sfa(.*)$ http://example.com/pf2$1 [R=301,L]
# Former Rule 3
# Rewrite to HTTP for non-secure pages
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?:afa|pf[12])(?:/)?)?((?:index|page[12])\.html)?$ http://example.com/$1$2 [R=301,L]
# New Rule 5
# Rewrite to HTTPS for secure pages
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:bookings2|private)(?:/)?)?((?:index|page[34])\.html)?$ [example.com...] [R=301,L]
The page isn't redirecting properly. Pale Moon has detected that the server is redirecting the request for this address in a way that will never complete.
How many different directories are there, and what are their names?Do I need to include reference to all the files and directories further down the hierarchy in "Former Rule 3" and "New Rule 5"? I don't presently have *all* subdirectories included in the rules, just those at the top of each tree, below which all are expected to be treated similarly.
The page isn't redirecting properly.
# Former Rule 3
# Rewrite to HTTP for non-secure pages
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?:afa|pf[12])(?:/)?)?((?:index|page[12])\.html)?$ http://example.com/$1$2 [R=301,L]
# New Rule 5
# Rewrite to HTTPS for secure pages
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:bookings2|private)(?:/)?)?((?:index|page[34])\.html)?$ [example.com...] [R=301,L]
RewriteRule ^({list-all-secure-directories-here}/)index\.html https://www.example.com/$1 [R=301,L,NS}
RewriteRule ^({list-all-nonsecure-directories-here}/)?index\.html http://www.example.com/$1 [R=301,L,NS}
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?:afa|pf[12])/.*)?$ http://example.com/$1 [R=301,L] RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:bookings2|private).*) https://example.com/$1 [R=301,L RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^(full-path-leading-to-page[12])$ http://example.com/$1 [R=301,L]
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^^(full-path-leading-to-page[34])$ https://example.com/$1 [R=301,L
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^full-path-here/(page[12])$ http://example.com/full-path-here/$1 [R=301,L]
HTTP Files
----------
(1) index.html:
index.html /
index.html /afa/
index.html /art/
index.html /bookings1/
index.html /classes/
index.html /els/
index.html /faqs/
index.html /fees/
index.html /forms/
index.html /gallery/
index.html /pf1/
index.html /pf2/
index.html /rfa/
(2) 'other'.html:
tour.html /
example.html /
example-sling.html /
banner.html /art/ - The PHP include header of all pages
buttons-row1.html /art/ - PHP include buttons for all pages
buttons-row2.html /art/ - PHP include buttons for all pages
buttons-row3.html /art/ - PHP include buttons for all pages
contacts.html /art/ - The PHP include footer of all pages
HTTPS Files
-----------
(1) index.html:
index.html /admin/
index.html /bookings2/
index.html /private/
index.html /private/history/
index.html /private/reference/
index.html /private/admin/
index.html /private/admin/counter/
index.html /private/admin/file-log/
index.html /private/admin/files/
index.html /private/admin/page-log/
index.html /private/admin/test/
index.html /private/trainers/
(2) 'other'.html:
booking-entry.html /bookings2/
booking-save.html /bookings2/
identity.html /private/history/
bookmarks.html /private/reference/
buttons-row4.html /private/admin/
booking-entry.html /private/admin/test/ - Development version
booking-save.html /private/admin/test/ - Development version
characters.html /private/admin/test/
course-data-read.html /private/admin/test/
links-index.html /private/admin/test/
# Rewrite to HTTP for non-secure 'other'.html pages at the rootBut there are still problems:
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((?:tour|example[-a-z]+)\.html)$ http://example.com/$1 [R=301,L]
# Rewrite to HTTP for non-secure 'other'.html pages in /art/
# RewriteCond %{HTTPS} =on [OR]
# RewriteCond %{SERVER_PORT} 443
# RewriteRule ^((?:banner|buttons-row[123]|contacts)\.html)$ http://example.com/art/$1 [R=301,L]
# Rewrite to HTTPS for secure 'other'.html pages in /bookings2/
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:booking-entry|booking-save)\.html)$ [example.com...] [R=301,L]
# Rewrite to HTTPS for secure identity.html page in /private/history/
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^identity\.html$ [example.com...] [R=301,L]
# Rewrite to HTTPS for secure bookmarks.html page in /private/reference/
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^bookmarks\.html$ [example.com...] [R=301,L]
# Rewrite to HTTPS for secure buttons-row4.html page in /private/admin/
# RewriteCond %{HTTPS} =off [OR]
# RewriteCond %{SERVER_PORT} !443
# RewriteRule ^buttons-row4\.html$ [example.com...] [R=301,L]
# Rewrite to HTTPS for secure 'other'.html pages in /private/admin/test/
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:characters|course-data-read|links-index)\.html)$ [example.com...] [R=301,L]
# Rewrite to HTTP for non-secure 'other'.html pages
# RewriteCond %{HTTPS} =on [OR]
# RewriteCond %{SERVER_PORT} 443
# RewriteRule ^((?:art)/.*)?$ http://example.com/$1 [R=301,L]
# Rewrite to HTTPS for secure 'other'.html pages
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((?:bookings2|private/history|private/reference|private/admin|private/admin/test).*) [example.com...] [R=301,L]
# Rewrite to HTTP for non-secure index.html pages
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^((afa|als|art|bookings|classes|els|faqs|fees|forms|gallery|pf1|pf2|rfa|unused)/)?index\.html http://example.com/$1 [R=301,L,NS]
# Rewrite to HTTPS for secure index.html pages
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{SERVER_PORT} !443
RewriteRule ^((admin|bookings2|private|private/history|private/reference|private/admin|private/admin/counter|private/admin/file-log|private/admin/files|private/admin/page-log|private/admin/test|private/trainers)/)index\.html [example.com...] [R=301,L,NS]
Requesting "http://oldexample.com/private/admin/test/links-index.html" yields "http://example.com/401.shtml" in the URL bar and "Not Found".
Note that when you specify an ErrorDocument that points to a remote URL (ie. anything with a method such as http in front of it), Apache HTTP Server will send a redirect to the client to tell it where to find the document, even if the document ends up being on the same server. This has several implications, the most important being that the client will not receive the original error status code, but instead will receive a redirect status code. This in turn can confuse web robots and other clients which try to determine if a URL is valid using the status code. In addition, if you use a remote URL in an ErrorDocument 401, the client will not know to prompt the user for a password since it will not receive the 401 status code. Therefore, if you use an ErrorDocument 401 directive then it must refer to a local document.
http://example.com/401.shtmlI have not specified custom error documents, relying on the server's default pages.
GET /401.shtml HTTP/1.1
Host: example.com
...
HTTP/1.1 404 Not Found
Date: Wed, 21 May 2014 03:53:03 GMT
Server: Apache
Content-Length: 326
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
----------------------------------------------------------
RewriteRule ^((?:characters|course-data-read|links-index)\.html)$ [example.com...] [R=301,L]is not working correctly.
It appears the 'Host Name Canonicalisation' rewrite is working to establish the correct domain, but the later rule 'Rewrite to HTTPS
I have not specified custom error documents, relying on the server's default pages.
http://oldexample.com/private/admin/test/links-index.htmlThe immediate response is '301' as specified "[R=301,L]", not '302'. It apparently then sees the need for authentication, having been pointed to the target "https://example.com/private/admin/test/$1", but doesn't request it for some reason unknown to me.
GET /private/admin/test/links-index.html HTTP/1.1
Host: oldexample.com
...
HTTP/1.1 301 Moved Permanently
Date: Wed, 21 May 2014 07:45:54 GMT
Server: Apache
WWW-Authenticate: Basic realm="Example - Members Only"
Location: http://example.com/401.shtml
Content-Length: 247
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
----------------------------------------------------------
http://example.com/401.shtml
GET /401.shtml HTTP/1.1
Host: example.com
...
HTTP/1.1 404 Not Found
Date: Wed, 21 May 2014 07:45:54 GMT
Server: Apache
Content-Length: 326
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
----------------------------------------------------------
http://example.com/favicon.ico
GET /favicon.ico HTTP/1.1
Host: example.com
...
HTTP/1.1 200 OK
Date: Wed, 21 May 2014 07:45:55 GMT
Server: Apache
Last-Modified: Sun, 18 Sep 2011 08:25:00 GMT
Accept-Ranges: bytes
Content-Length: 824
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: image/x-icon
----------------------------------------------------------