You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Scott Haneda <ta...@newgeo.com> on 2009/10/20 00:17:00 UTC
[users@httpd] Conditional .htaccess
Is it possible to have .htacess values be conditional in any way. For
example:
if (my ip address is accessing the site)
some apache directive here
end if
--
Scott * If you contact me off list replace talklists@ with scott@ *
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Conditional .htaccess
Posted by Scott Haneda <ta...@newgeo.com>.
Ah ha, very nice idea. As long as my sites are not relying on the
hostname, which I rarely every use src=http://example.com/file.foo and
use src=/file.foo, then I should be ok.
Thanks, I never thought about approaching it that way, good idea.
--
Scott * If you contact me off list replace talklists@ with scott@ *
On Oct 19, 2009, at 4:39 PM, LuKreme wrote:
> On 19-Oct-2009, at 17:23, Scott Haneda wrote:
>> php admin value and php flag values, I would like to only be
>> enabled for my IP address, but publicly, I want them off, so the
>> public does not see errors, only I do.
>
> I think the way to do this is to setup a different location.
>
> Something like this (this is for webdav, but the idea is the same):
>
> <VirtualHost *>
> ServerName www.example.com
> ServerAlias example.com
> DocumentRoot /usr/home/ksmith/http/
> CustomLog /home/ksmith/logs/site.log combined
> ErrorLog /home/ksmith/logs/site_error.log
> </VirtualHost>
>
>
> <virtualhost *>
> ServerName webdav.example.com
> DocumentRoot /usr/home/ksmith/http/
> DavLockDB /tmp/DavLock.example
> CustomLog /home/ksmith/logs/sitedav.log combined
> ErrorLog /home/ksmith/logs/site_daverror.log
> <location />
> DAV On
> AuthType Basic
> AuthName "Example.com DAV"
> AuthUserFile /home/ksmith/.htdavpass
> #AllowOverride All
> ForceType text/plain
> require valid-user
> </location>
> </virtualhost>
>
> notice the two virtualhosts are pointing at the same content.
>
> You would do something similar to create a, say,
> phpadmin.example.com that turned on the directives you wanted:
>
> <virtualhost *>
> ServerName phpa.example.com
> DocumentRoot /usr/home/ksmith/http/
> php_flag display_errors on
> </virtualhost>
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
[users@httpd] Re: Conditional .htaccess
Posted by LuKreme <kr...@kreme.com>.
On 19-Oct-2009, at 17:23, Scott Haneda wrote:
> php admin value and php flag values, I would like to only be enabled
> for my IP address, but publicly, I want them off, so the public does
> not see errors, only I do.
I think the way to do this is to setup a different location.
Something like this (this is for webdav, but the idea is the same):
<VirtualHost *>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /usr/home/ksmith/http/
CustomLog /home/ksmith/logs/site.log combined
ErrorLog /home/ksmith/logs/site_error.log
</VirtualHost>
<virtualhost *>
ServerName webdav.example.com
DocumentRoot /usr/home/ksmith/http/
DavLockDB /tmp/DavLock.example
CustomLog /home/ksmith/logs/sitedav.log combined
ErrorLog /home/ksmith/logs/site_daverror.log
<location />
DAV On
AuthType Basic
AuthName "Example.com DAV"
AuthUserFile /home/ksmith/.htdavpass
#AllowOverride All
ForceType text/plain
require valid-user
</location>
</virtualhost>
notice the two virtualhosts are pointing at the same content.
You would do something similar to create a, say, phpadmin.example.com
that turned on the directives you wanted:
<virtualhost *>
ServerName phpa.example.com
DocumentRoot /usr/home/ksmith/http/
php_flag display_errors on
</virtualhost>
--
I WILL NOT STRUT AROUND LIKE I OWN THE PLACE
Bart chalkboard Ep. 2F15
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Conditional .htaccess
Posted by Scott Haneda <ta...@newgeo.com>.
On Oct 19, 2009, at 4:21 PM, Jonathan Zuckerman wrote:
> On Mon, Oct 19, 2009 at 3:17 PM, Scott Haneda <ta...@newgeo.com>
> wrote:
>> Is it possible to have .htacess values be conditional in any way.
>> For
>> example:
>>
>> if (my ip address is accessing the site)
>> some apache directive here
>> end if
>>
> ".htaccess values" could be more specific...
> .htaccess is a file which allows you to do many types of apache
> configuration dynamically in a directory without having to restart the
> webserver. If you're talking about URL rewriting, here's somewhere to
> start (replace the 2.2 with whatever major.minor version of apache
> you're using):
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond
Sorry, I should have been more specific
php admin value and php flag values, I would like to only be enabled
for my IP address, but publicly, I want them off, so the public does
not see errors, only I do.
--
Scott * If you contact me off list replace talklists@ with scott@ *
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Conditional .htaccess
Posted by Jonathan Zuckerman <j....@gmail.com>.
On Mon, Oct 19, 2009 at 3:17 PM, Scott Haneda <ta...@newgeo.com> wrote:
> Is it possible to have .htacess values be conditional in any way. For
> example:
>
> if (my ip address is accessing the site)
> some apache directive here
> end if
>
> --
> Scott * If you contact me off list replace talklists@ with scott@ *
>
>
> ---------------------------------------------------------------------
> 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@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
".htaccess values" could be more specific...
.htaccess is a file which allows you to do many types of apache
configuration dynamically in a directory without having to restart the
webserver. If you're talking about URL rewriting, here's somewhere to
start (replace the 2.2 with whatever major.minor version of apache
you're using):
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org