Re: Mod Rewrite Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Joshua Slive" <joshua@xxxxxxxx>
Reply-To: users@xxxxxxxxxxxxxxxx
To: users@xxxxxxxxxxxxxxxx
Subject: Re:  Mod Rewrite Help
Date: Fri, 17 Aug 2007 09:58:12 -0400

On 8/17/07, wi <icebattle@xxxxxxxxx> wrote:
> You'll need to configure a virtual host listening to the 8765 interface.
> Once you've done that, you will simply need to put together a rewrite to
> send requests to /abc.html to whatever target url you want.
>
> Start by reading http://httpd.apache.org/docs/2.2/vhosts/
>
> From there, configuring the rewrite will be the next task.

Or, if you don't want the virtual host, you can use a RewriteCond
based on the %{SERVER_PORT} as mentioned here:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule

Joshua.


More help question.

I've wondered if is is necessary to use the RewriteEngine every time another redirect set is used like this for example:

## stop offender & redirect to "why" page
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^webwalk [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^yodao
RewriteRule .* /usr/local/www/vhost/whystopped.htm

## replace stolen images with "illegal" image
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?vhost.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.mainhost.net/images/illegal.gif [R,L]

## forbidden 403
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} Zango [NC,OR]
RewriteCond %{HTTP_USER_AGENT} link_checker
RewriteRule ^.* - [F,L]

.....or, could this be used, just turning on the engine once at the very top:

## stop offender & redirect to "why" page
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^webwalk [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^yodao
RewriteRule .* /usr/local/www/vhost/whystopped.htm

## replace stolen images with "illegal" image
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?vhost.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.mainhost.net/images/illegal.gif [R,L]

## forbidden 403
RewriteCond %{HTTP_USER_AGENT} Zango [NC,OR]
RewriteCond %{HTTP_USER_AGENT} link_checker
RewriteRule ^.* - [F,L]

Thanks for advice.

Jack

_________________________________________________________________
Booking a flight? Know when to buy with airfare predictions on MSN Travel. http://travel.msn.com/Articles/aboutfarecast.aspx&ocid=T001MSN25A07001


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux