0

I have develop machine, which is windows and I will deploy my website to an ubuntu server. so, how can one .htaccess file use different directive under different environment.

for example:

php_value auto_prepend_file D:\123\bigsite\include\global.php

in ubuntu, i should replace the value with another location.

I use svn and a post hook to automaticlly check out files to ubuntu server, so when i check in to svn, the .htaccess content is the same in the windows

vascowhite
  • 18,120
  • 9
  • 61
  • 77
lovespring
  • 19,051
  • 42
  • 103
  • 153

1 Answers1

1

Your .htaccess file will work the same on Windows or Linux so long as you have Apache set up the same.

You can of course have one .htaccess file on your dev machine and another with different settings on your production server, just remember not to overwrite them by mistake. If you are using svn then you should add .htaccess to the ignore list.

For example if the .htaccess file on your windows machine has the line:-

php_value auto_prepend_file D:\123\bigsite\include\global.php

Then the .htaccess file on your ubuntu machine may be:-

php_value auto_prepend_file /srv/123/bigsite/include/global.php

http://httpd.apache.org/docs/current/howto/htaccess.html

Community
  • 1
  • 1
vascowhite
  • 18,120
  • 9
  • 61
  • 77