Question

I'm using a script on several webhosting providers and want just to transfer the whole script to the server if a new version is released.

But every server has its own absolute path to the AuthFile (for directory protection). .htaccess needs an absolute path to the AuthFile and this absolute path is different on every server.

My first approach was to use one .htaccess-file with several <Directory>-directives. Each with an absolute path which sets the AuthFile for the specific server. But I got a 500 internal server error: .htaccess: <Directory not allowed here

The second idea was to use SetEnv and <IfDefine>. But IfDefine is not able to read environment-variables as shown in this blog entry.

The specific paths and servers are known.

Is there a way to find out on which server the .htaccess is called and to set the specific path for the AuthFile?

Was it helpful?

Solution

Now I solved this problem to create a script which parses the .htaccess files and checks whether the paths are set correctly for the specific server.

Not the solution I hoped for, but better than no solution :-/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top