Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Apache Rewrite Server & Virtual Host
Results 1 to 6 of 6

Thread: Apache Rewrite Server & Virtual Host

  1. #1

    Apache Rewrite Server & Virtual Host

    Is it possible to create a set of Rewrites, once, in the "server" configuration section as opposed to in each Virtual Host? The intent is to write one set of rules for blocking a range of bots. my thought is to write them in the 1st Virtual Host, which is a wild card?

  2. #2
    I've never tried that, but according to the scope documented it seems this would be possible. You would not put this in the first virtual host for it to apply to the remaining, but rather the "server" context. I would suggest you might consider an alternative to dealing with the bots, such as using iptables.

  3. #3
    Thanks hysterik ... By the server context do you mean in the http.conf itself ... from a bot perspective I am not sure if the IP Ranges will be easy to manage this is why I was considering Rule Method

  4. #4
    Yes, you can set a rewrite in the default site itself. Any hosts that do not match any of my listening servers, are redirected to a default site.


    Code:
    --snip--
    
            <Directory /var/www/>
                    Options FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
                    # This directive allows us to have apache2's default start page
                    # in /apache2-default/, but still have / go to the right place
                    RedirectMatch ^/$ http://www.myserver.com/
            </Directory>
    
    --snip--
    Hope that helps. Of course you can make more rules of course.
    arrogance breeds ignorance


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

  5. #5
    Hi Kernel_Killer ... My thoughts are that I would like each match to run the same set of rules (So I dont have to repeat the rules for each site or if they change I only need to change them in one spot. ... so I was wondering if I put the Rewrite rule in the httpd.conf is possible? (I believe in the example you are giving the default site the rule would be executed only if there was not a match. Or am I missing the intent of your message?)

  6. #6
    Correct. That is for the default site, and if nothing matches a host, it's redirected elsewhere. Depending on what you want it to match, you just need to change the regex (^/$) to what you want it to match. Of course, you can use multiple rules.

    Here's the apache doc on the RedirectMatch itself. http://httpd.apache.org/docs/1.3/mod...#redirectmatch
    If you need a hand writing the regex, just post back.
    arrogance breeds ignorance


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Similar Threads

  1. Adding Directory to Apache Virtual Host!
    By honey bee in forum Linux - Hardware, Networking & Security
    Replies: 7
    Last Post: 09-27-2006, 03:56 PM
  2. Virtual host/local host PAM File problem!
    By honey bee in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 03-01-2006, 01:38 PM
  3. apache virtual host
    By mars in forum Linux - General Topics
    Replies: 1
    Last Post: 01-15-2005, 07:30 AM
  4. VIRTUAL HOST HELP
    By -=amity=- in forum Linux - General Topics
    Replies: 2
    Last Post: 07-17-2004, 07:23 PM
  5. Name Based Virtual Host help
    By datamike in forum Linux - General Topics
    Replies: 3
    Last Post: 12-27-2002, 11:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •