.htaccess file in apache server config

I recently read an article that said using .htaccess is a slight performance hit as apache has to look in every directory it goes through for an .htaccess file. So I've been trying to get rid of all my .htaccess files but have found it's not as easy as copying and pasting the code in the config file.

Here's the contents of my current .htaccess file:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !index.php
    RewriteRule (.*)\.php$ index.php/$1
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php

and this is the block I'm trying to paste it into in my default file in site-available in apache2.

<Directory /old>
                Order Deny,Allow
                Deny from all
                Allow from 192.168.1
                # trying to paste in here

It works fine when I use the .htaccess file in the /old directory but as soon as I put the code in the config file it doesn't. Does anyone have any idea why this is?


Sorry I'm an idiot...I was trying to deny all traffic outside of my local network and forgot that the local computer will have the ip After adding this in was a matter of changing AllowOverride to None in the root directory and dropping the contents of the .htaccess file into the appropriate directory.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.