httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Cicimov <>
Subject Re: [users@httpd] mod_rewrite and location
Date Mon, 29 Mar 2010 09:42:20 GMT
Your RewriteRule is wrong redirects everything to index.php in the root
directory where you dont have access

On Mar 29, 2010 8:24 PM, "Henrik Gemal" <> wrote:

 I use mod_rewrite and in the root of the website I have this in the
.htaccess file:

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^(.*)$ index.php?url=$1 [qsappend,last]

My index.php is simple:
<?php echo "hello"; ?>

My URLs are something like this:

Now I want to restrict the access to /program2 to certain IP.

I've tried:
<Location />
  Order deny,allow
  Deny from all
<Location /program1>
  Order deny,allow
  Allow from all
<Location /program2>
  Order deny,allow
  Allow from

But it doesn't work

If I try to load http://localhost/program2 I get:
"You don't have permission to access /index.php on this server."

So it had something to do with mod_rewrite


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
 "   from the digest:
For additional commands, e-mail:

View raw message