Forum Moderators: phranque
[Tue Mar 02 18:18:30 2010] [error] [client 165.145.140.230] File does not exist: /home/server/public_html/thecat, referer: http://www.example.com/cat/subcat RewriteRule ^([A-Za-z-]+)/([A-Za-z+-]+)$ /file.php?cat=$1&subcat=$2 [L] IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*
##Header append X-FRAME-OPTIONS "DENY"
## Error document review
ErrorDocument 404 /index.php
AddType application/x-httpd-php .htm .xml .rss
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)=http [NC]
RewriteRule ^(.*)$ – [F,L]
# remove trailing slash
RewriteRule (.*)/$ /$1 [L,R=301]
RewriteRule (.*)\.xml(.*) $1.php$2 [nocase] [edited by: jdMorgan at 6:59 pm (utc) on Mar 3, 2010]
[edit reason] Please use example.,com only. [/edit]
# Set options overriding server config (See Options and
# AllowOverride directives, and adjust as necessary)
Options -Indexes -MultiViews +FollowSymLinks
#
# Disable PathInfo if not used (Apache 2.0 and above only)
AcceptPathInfo Off
#
# Don't list these filetypes in directory index displays
# (if indexes are allowed -- see Options line above)
IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*
#
# Send X-Frame-Options HTTP response header (Corrected directive and case)
#Header set X-Frame-Options: "sameorigin"
#
# Define the custom 404 error document
ErrorDocument 404 /index.php
#
# Use php MIME-type kludge to invoke PHP interpreter
AddType application/x-httpd-php .htm .xml .rss
#
# Enable the rewrite engine
RewriteEngine On
#
# Forbid access by libwww or any request containing "=http" in the query string
RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
RewriteCond %{QUERY_STRING} \=http [NC]
RewriteRule ^.*$ – [F]
#
# Remove trailing slash on URLs rewritten below unless
# the requested URL-path resolves to an existing directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z-]+)/([a-z+-]+)/$ http://www.example.com/$1 [NC,R=301,L]
#
# Rewrite requested URL-paths of the form /dir/string to "file.php" script
RewriteRule ^([a-z-]+)/([a-z+-]+)$ /file.php?cat=$1&subcat=$2 [NC,L]
#
# Rewrite .xml requests to corresponding php files
RewriteRule ^(.*)\.xml$ /$1.php [NC,L]