|
Home > Archive > Apache Server configuration support > April 2004 > UNIX + Windows htaccess in one file possible?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
UNIX + Windows htaccess in one file possible?
|
|
| Ralf Gmeiner 2004-04-26, 11:34 am |
| Hello!
I use WAMP for developing and LAMP for hosting my website.
Sometimes I need to password-protect certain directories. On the LAMP-Server
I need to put
AuthUserFile "/somepath/.htpasswd"
into my htaccess file to point to the password-file. On the WAMP-Server,
however, it's:
AuthUserFile "c:\someotherpath\htdocs\.htpasswd"
This requires me to use two different htaccess-files (win.htaccess and
linux.htaccess), that each must be renamed to .htaccess on the approriate
server. This method is quite circumstantial. I don't know how to put logic
into the htacces files (if LAMP use this directory; else use that
directory). Hence my question:
Is it possible to use a single htaccess-file on both systems? If so how?
Thanks for your help.
Ralf
| |
| Davide Bianchi 2004-04-26, 11:34 am |
| Ralf Gmeiner <rgmeiner@gmx.de> wrote:
> I don't know how to put logic into the htacces files
You can't.
> Is it possible to use a single htaccess-file on both systems?
No. They are two _different_ system.
You could do two things:
1. setup a Linux environment to use, Linux is basically Unix, so you
can use that environment to test things and have the same identical
configuration
2. use an automatic script that automatically change your .htaccess files
Davide
| |
|
| Not sure if this would work on Unix but is some what of an option on a dual
boot Linux/windows system.
Try setting up a partition in Fat32 that both Linux and Windows can read and
in there create your htpasswd file.
It should work.
Or stop playing about and just stay with penguin power!!!
Andy
"Ralf Gmeiner" <rgmeiner@gmx.de> wrote in message
news:c6j9qr$cos82$1@ID-29177.news.uni-berlin.de...
> Hello!
>
> I use WAMP for developing and LAMP for hosting my website.
>
> Sometimes I need to password-protect certain directories. On the
LAMP-Server
> I need to put
>
> AuthUserFile "/somepath/.htpasswd"
>
> into my htaccess file to point to the password-file. On the WAMP-Server,
> however, it's:
>
> AuthUserFile "c:\someotherpath\htdocs\.htpasswd"
>
> This requires me to use two different htaccess-files (win.htaccess and
> linux.htaccess), that each must be renamed to .htaccess on the approriate
> server. This method is quite circumstantial. I don't know how to put logic
> into the htacces files (if LAMP use this directory; else use that
> directory). Hence my question:
>
> Is it possible to use a single htaccess-file on both systems? If so how?
>
> Thanks for your help.
>
> Ralf
>
| |
|
| "Ralf Gmeiner" <rgmeiner@gmx.de> schreef in bericht
news:c6j9qr$cos82$1@ID-29177.news.uni-berlin.de...
> Hello!
> I use WAMP for developing and LAMP for hosting my website.
> Sometimes I need to password-protect certain directories. On the
LAMP-Server
> I need to put
> AuthUserFile "/somepath/.htpasswd"
> into my htaccess file to point to the password-file. On the WAMP-Server,
> however, it's:
> AuthUserFile "c:\someotherpath\htdocs\.htpasswd"
Assuming Apache is installed somewhere at C:\, I'ld try this:
Create the folder(structure) '\somepath' at C:\ too and put the one and only
'.htpasswd' there. Change the AuthUserFile-line at WAMP to:" AuthUserFile
/somepath/.htpasswd "
HansH
|
|
|
|
|