UNIX + Windows htaccess in one file possible?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > UNIX + Windows htaccess in one file possible?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    UNIX + Windows htaccess in one file possible?  
Ralf Gmeiner


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-04 04:34 PM

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






[ Post a follow-up to this message ]



    Re: UNIX + Windows htaccess in one file possible?  
Davide Bianchi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-04 04:34 PM

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





[ Post a follow-up to this message ]



    Re: UNIX + Windows htaccess in one file possible?  
News


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-04 08:33 PM

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
>







[ Post a follow-up to this message ]



    Re: UNIX + Windows htaccess in one file possible?  
HansH


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-04 08:33 PM

"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












[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:46 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register