Forum Moderators: phranque

Message Too Old, No Replies

conditional in htaccess

         

EvertVd

10:02 am on Apr 3, 2012 (gmt 0)

10+ Year Member



I am using syncing to keep the developing and production versions of a website up-to-date. this works perfectly except for one thing: there is an instruction in the htaccess file which should run on the remote server, but not on the dev-box. It is *not* an option to exclude the htaccess from syncing.

So I was wondering if there is some condictional based on the server htaccess is on? The instruction is:


<FilesMatch "\.php$">
AddHandler x-httpd-php53.php
</FilesMatch>

g1smd

10:11 am on Apr 3, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No.


You're going to have to get creative with your sync process and site config.

.htaccess.dev on the dev site runs the dev site.

.htaccess for the live site is merely stored on the dev site, unused.

You'll need to alter the dev site main config to look for .htaccess.dev instead of .htaccess here.

You'll need to manually alter both files when you make changes.


The alternative is to add that extra setting to httpd.conf and not have it in .htaccess at all.

EvertVd

12:42 pm on Apr 3, 2012 (gmt 0)

10+ Year Member



Too bad. Thanks.

g1smd

1:52 pm on Apr 3, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Both are do-able with the right level of server access.

EvertVd

2:03 pm on Apr 3, 2012 (gmt 0)

10+ Year Member



I'll have to think a bit about how I can change the workflow (taking into account the syncing) and see what is the best method. thanks for you suggestions