Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

UNIX + Windows htaccess in one file possible?

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Acess files on PC through server  
Author Message
rgmeiner

External


Since: Jul 04, 2003
Posts: 6



(Msg. 1) Posted: Mon Apr 26, 2004 8:24 pm
Post subject: UNIX + Windows htaccess in one file possible?
Archived from groups: alt>apache>configuration (more info?)

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

 >> Stay informed about: UNIX + Windows htaccess in one file possible? 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Mon Apr 26, 2004 8:24 pm
Post subject: Re: UNIX + Windows htaccess in one file possible? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ralf Gmeiner <rgmeiner.RemoveThis@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<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: UNIX + Windows htaccess in one file possible? 
Back to top
Login to vote
amoran

External


Since: Apr 26, 2004
Posts: 1



(Msg. 3) Posted: Mon Apr 26, 2004 10:43 pm
Post subject: Re: UNIX + Windows htaccess in one file possible? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.TakeThisOut@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
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: UNIX + Windows htaccess in one file possible? 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 4) Posted: Tue Apr 27, 2004 12:04 am
Post subject: Re: UNIX + Windows htaccess in one file possible? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Ralf Gmeiner" <rgmeiner.TakeThisOut@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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: UNIX + Windows htaccess in one file possible? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Unix-Timestamp prior 1.1.1970 on Windows - Moin, moin, I have a smal problem with the php-function for Date ( mktime(), date() ). I get the errormessage: Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 I get this, when the parameter is negative o...

htaccess on Windows - Hi all Have Apache 1.3 running on Win2k, can I use htaccess to make a password access for a Directory ??? Have tried it .......but nothing happend. Is this only for Unix/linux Systems regards Mark

.htaccess file makes 403 - hi folks, i wrote a .htaccess file with the following content: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteBase / RewriteRule ^typo3$ typo3/index_re.php RewriteRule ^[^/]*\.html$ index.php but when accessing this page, a 403..

Can htaccess include another file? - Hi, I want to achieve something like this. Imagine I have a file called textfile_ips.txt which contains a whole bunch of IP addresses which I want to blocked, one per line. Can I do something like this? <Files "somefile.html"> deny ...

DirectoryIndex, and other commands for the htaccess file??? - I'm on a shared host (Apache/RedHat), and I'm new with setting up various directories for my files. I've created an htaccess file in the root, and I've set up most of my web site files under "/httpdocs". Inside that htaccess file, I've added..
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]