Welcome to WebmasterWorld Guest from 23.22.220.37

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Set value in httpd.conf and ask for it in .htaccess

Apache 2.2

     
1:38 pm on Oct 29, 2010 (gmt 0)

Preferred Member

5+ Year Member

joined:Jan 20, 2007
posts: 354
votes: 0


Hello!

One of my hosters requires to set this in the .htaccess in order to use Php5:
AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php

But this is destroing my local development-settings, which means using this code in the htaccess makes my local apache-server serve php-code uninterpreted. So every time I upload a site I have to uncomment these 2 lines.

Any idea how to I could avoid this? My idea now was to do something like:

httpd.conf:
Set MyDevelopingMachine=1

.htaccess:
<if !MyDevelopingMachine>
AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php
</if>

Any idea how to do this in Apache 2.2?
8:54 pm on Oct 29, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


I don't know how to do this, but even beyond this particular problem, in the long-term it would be a good idea to set up your development server identically to your production server...

I hope someone else can give you a better answer for the short-term, though. <bump>

Jim
4:12 pm on Nov 3, 2010 (gmt 0)

Preferred Member

5+ Year Member

joined:Jan 20, 2007
posts: 354
votes: 0


Thanks for your reply. It would be ideal to have an identicall set up in the development and production server, but I'm deveolping for a variety of webhosters, so I guess it's not practical to do so.

I found a partial solution by testing for a module this webhoster hasn't got while it's activated on the local machines (hoping this doesn't change...).