http://httpd.apache.org/docs-2.0/misc/rewriteguide.html
- Code: Select all
Browser Dependent Content
Description:
At least for important top-level pages it is sometimes necessary to provide the optimum of browser dependent content, i.e. one has to provide a maximum version for the latest Netscape variants, a minimum version for the Lynx browsers and a average feature version for all others.
Solution:
We cannot use content negotiation because the browsers do not provide their type in that form. Instead we have to act on the HTTP header "User-Agent". The following condig does the following: If the HTTP header "User-Agent" begins with "Mozilla/3", the page foo.html is rewritten to foo.NS.html and and the rewriting stops. If the browser is "Lynx" or "Mozilla" of version 1 or 2 the URL becomes foo.20.html. All other browsers receive page foo.32.html. This is done by the following ruleset:
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/3.*
RewriteRule ^foo\.html$ foo.NS.html [L]
RewriteCond %{HTTP_USER_AGENT} ^Lynx/.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[12].*
RewriteRule ^foo\.html$ foo.20.html [L]
RewriteRule ^foo\.html$ foo.32.html [L]
- Code: Select all
RewriteCond %{REMOTE_ADDR} ^123\.45\.67\.[8-9]$
Anstatt nach Browser zu unterscheiden, müsstest in diesem Beispiel nach IP unterscheiden, frag mich aber nicht was die Krpytischen Zeichen bedeuten

ich deute es mal als 123.45.67.8-9
- Code: Select all
RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} !^friend1@client1.quux-corp\.com$
Bei Unix Systemen, hat der aktuell eingeloggte Benutzer, eine Öffentlich einsehbare Ident (meistens der Benutzername selber) was du unter Windows Ignorieren kannst. Zumindest mit Remote_Host kann man auch den DNS namen eines Rechners benutzten, anstatt der IP. Liegt also bei dir was dir lieber ist

Ubuntu 18.04 | SMP P3 1.4 GHz | 6 GByte RegECC | 74 GByte Seagate 15k5 system | 3Ware 9550SXU-4LP with 4x 500 GByte Seagate ES2 Raid 10 data | StoreCase DE400 | PX-230A | Intel Pro/1000MT Dual PCI-X