...

View Full Version : changed .htaccess now PHP include not working



boogily
05-18-2011, 06:52 PM
I overwrote the .htaccess file when updating my site. I have different sites in subfolders. These sites use php includes like
<html xmlns="http://www.w3.org/1999/xhtml">
<?php include("header.php"); ?>
<body>
And they worked fine. However, when I overwrote the .htaccess file, it seemed to disable all of those. Of course, I can't find the old .htaccess file. I do know that I did not individually set each php include in the .htaccess. It just used to work and now it doesn't.

Here is the new .htaccess


## Can be commented out if causes errors, see notes above.
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch

#
# mod_rewrite in use

RewriteEngine On
<FilesMatch "\.(gif|jpg|jpeg|png)$">
ExpiresActive On
ExpiresDefault "access plus 1 month"
</FilesMatch>

<FilesMatch "\.(css|js|html?|xml|txt)$">
ExpiresActive On
ExpiresDefault "access plus 1 week"
</FilesMatch>

## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# RewriteBase /


#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/ico "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

boogily
05-18-2011, 07:34 PM
Solved! added

# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php .html



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum