PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 11, 2022

[FIXED] How can .htaccess use different directive under different OS

 February 11, 2022     .htaccess, apache, lamp, php, svn     No comments   

Issue

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


Solution

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



Answered By - vascowhite
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing