.htaccess includes



Im using php_value to prepend/append the header/footer files on each of my pages on this website: edval60th.com

However it is not working. I have a feeling that it has to do with the web server’s OS switching over to Ubuntu. Here is what my .htaccess file looks like.

# Deny directory listing
Options -Indexes

# No file extension
Options +FollowSymlinks

# Appends and Prepends header/footer on each page
php_value auto_prepend_file "/home/mikelevy/edval60th.com/includes/header.php"
php_value auto_append_file "/home/mikelevy/edval60th.com/includes/footer.php"

# Redirects forbidden urls
ErrorDocument 403 http://edval60th.com

# Cant view files in includes folder
<Files ~ "\includes\.php$">
	Order allow,deny
	Deny from all

# Caching
<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf)$">
Header set Cache-Control "max-age=28800"

RewriteEngine On
RewriteBase /

# SEO Friendly URLs
RewriteRule comments/page/(.*) comments.php?page=$1
RewriteRule photos/page/(.*) photos.php?page=$1
RewriteRule slideshow/photo/(.*) slideshow.php?photo=$1
RewriteRule comments/page comments/page/1
RewriteRule photos/page photos/page/1
RewriteRule slideshow/photo slideshow/photo/1
RewriteRule ^login index.php?login
RewriteRule ^logout index.php?logout
RewriteRule ^includes /

# No file extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ /$1.php [L,QSA]

# Eliminate trailing slash
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript

Can anyone help me fix this? I would greatly appreciate it.





Use a custom PHP.ini, instead of “php_value”, to set auto_prepend_file and auto_append_file.


Im not entirely sure how I would do that. Could you possibly provide code snippet? And would the php.in file go inside the domain’s root directory?


Sorry. I just have not done too much editting of .htaccess files or using php.in