This is a discussion on Conflict between RewriteEngine and password protected dir? within the Apache Web Server forums, part of the Web Server and Related Forums category; Dear group, hope you can help with the following: In the root of my site I have a .htaccess with: ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Dear group, hope you can help with the following:
In the root of my site I have a .htaccess with: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] I also have a subdir /admin with the CMS of the site. But now I run into the following: during testing I had no password protection on that /admin-dir, and that dir was normally accessible. But no I wanted to give it some protection via a .htaccess in that /admin dir, and now this url domain.com/admin automatically redirects/rewrites to the root of the site, so without even asking for a login! The .htaccess of that /admin page is AuthType Basic AuthName "login" AuthUserFile "/home/path/to/passwd/file" require valid-user Is there a solution to use both that RewriteEngine and the htaccess-login in a dir below the webroot? Thanks in advance! Bob |
|
|||
|
On Jun 19, 3:31 pm, "Dr.Bob" <dr.bob.says.no.to.spa...@xs4all.nl>
wrote: > Dear group, hope you can help with the following: > > In the root of my site I have a .htaccess with: > RewriteEngine On > RewriteBase / > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_FILENAME} !-d > RewriteRule . /index.php [L] > > I also have a subdir /admin with the CMS of the site. > > But now I run into the following: during testing I had no password > protection on that /admin-dir, and that dir was normally accessible. But no > I wanted to give it some protection via a .htaccess in that /admin dir, and > now this url domain.com/admin automatically redirects/rewrites to the root > of the site, so without even asking for a login! > > The .htaccess of that /admin page is > AuthType Basic > AuthName "login" > AuthUserFile "/home/path/to/passwd/file" > require valid-user > > Is there a solution to use both that RewriteEngine and the htaccess-login in > a dir below the webroot? > > Thanks in advance! > Bob RewriteCond %{REQUEST_URI} !/admin something like that |
|
|||
|
"shimmyshack" <matt.farey@gmail.com> wrote in message
news:1182269876.360686.187010@g4g2000hsf.googlegro ups.com... > On Jun 19, 3:31 pm, "Dr.Bob" <dr.bob.says.no.to.spa...@xs4all.nl> > wrote: >> Dear group, hope you can help with the following: >> >> In the root of my site I have a .htaccess with: >> RewriteEngine On >> RewriteBase / >> RewriteCond %{REQUEST_FILENAME} !-f >> RewriteCond %{REQUEST_FILENAME} !-d >> RewriteRule . /index.php [L] >> >> I also have a subdir /admin with the CMS of the site. >> >> But now I run into the following: during testing I had no password >> protection on that /admin-dir, and that dir was normally accessible. But >> no >> I wanted to give it some protection via a .htaccess in that /admin dir, >> and >> now this url domain.com/admin automatically redirects/rewrites to the >> root >> of the site, so without even asking for a login! >> >> The .htaccess of that /admin page is >> AuthType Basic >> AuthName "login" >> AuthUserFile "/home/path/to/passwd/file" >> require valid-user >> >> Is there a solution to use both that RewriteEngine and the htaccess-login >> in >> a dir below the webroot? >> >> Thanks in advance! >> Bob > > RewriteCond %{REQUEST_URI} !/admin > something like that > Thanks Shimmyshack, will give it a try! Bob |