Rewrite one useragent to a static file

New to mod_rewrite? This is a good place to start.

Rewrite one useragent to a static file

Postby steve301 » Tue Aug 04, 2009 8:53 am

Hi,

This one should be easy.

I need to take all requests where the useragent is "Apache/2.2.3" and rewrite their request to a static page, like "test.heml"

This is to prevent apache internal dummy connections from requesting / and then bootstrapping drupal, which is a waste of resources for an internal dummy connection.

Thanks in advance...
steve301
 
Posts: 9
Joined: Tue Nov 25, 2008 10:13 am
Location: N.Y.

Postby richardk » Wed Aug 05, 2009 3:37 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} ^Apache/2.2.3$
RewriteRule ^$ /test.heml [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 27 guests

cron