Forum Moderators: phranque
All of the statements within work perfectly, though some had to be duplicated and edited, and prefaced with a RewriteCond directive to segregate which one was acted upon.
However there is one thing that I haven't worked out how to do. PHP includes worked fine on the development server from the very beginning, but not on the live server unless a line was added to the .htaccess file to specify where the 'PHP includes' folder was located:
php_value include_path /vhost/host4/e/x/1/example.co.uk/www/includes
However, that line has to be deleted before uploading the .htaccess file to the development server, and then added back before uploading to the live server.
How do I make that line conditional, so it knows "where it is", and then just works when it needs to?
There is no access to the php.ini PHP configuration file on the live server, as otherwise I would have edited that instead.
Without the line included, the live server looks at .:/usr/share/pear for include files, but I don't have access to that:
Warning: main(): Failed opening 'navigation.inc' for inclusion (include_path='.:/usr/share/pear') in /vhost/host4/e/x/1/example.co.uk/www/index.php on line 44.
php_value include_path /vhost/host4/e/x/1/example.co.uk/www/includes
your live server root directory is /vhost/host4/e/x/1/example.co.uk/www/ so you could therefore use the following relative path definition:
php_value include_path includes
on your development server, do the following:
cd /path/to/server/root/
ln -s /usr/share/pear includes
this will create a soft link named includes in your server root that will essentially make it look like /path/to/server/root/includes/ contains the includes directory.
and the relative-to-server-root path definition still works in this case...