Jump to content

Exclude 1 directory from htaccess rules.


Recommended Posts

<Directory !^/blog/$>

AddHandler application/x-httpd-php .css

AddHandler application/x-httpd-php .js



I cant get this to work. I just dont want these 2 rules to run within the subdirectory "blog" since its jacking up wordpress hard. I know im almost there and I found something that could have answered it last night but I cant for the life of me find it again! =\

Link to comment
Share on other sites

something else should be preventing it from working right? everything else works.


RewriteEngine On
Options +FollowSymLinks
Options All -Indexes
AddType application/x-httpd-php .php .xml
RewriteBase /
RewriteCond %{REQUEST_URI} !^/blog
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.+$
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*) http://thishorridsite.com/$1/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule (.+)\.html?$ http://thishorridsite.com/ [R=301]
RewriteRule ^engines/(.*)$ engines.php?query=$1 [L]
RewriteRule ^lamits/(.*)$ lambodoorkits.php?query=$1 [L]
RewriteRule ^radctors/(.*)$ beltronics.php?query=$1 [L]
RewriteRule ^whels/(.*)$ wheels.php?query=$1 [L]
RewriteRule ^whed/(.*)$ wheels-by-brand.php?query=$1 [L]
RewriteRule ^(.*)/$ a3.php?query=$1 [L]

ErrorDocument 400 /400.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php

# secure htaccess file
<Files .htaccess>
order allow,deny
deny from all

# deny access to evil robots site rippers
RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]
RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]
RewriteCond %{HTTP_USER_AGENT} ^attach [OR]
RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xenu [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* - [F,L]


<ifModule mod_headers.c>
  Header unset ETag
FileETag None

ExpiresActive On
ExpiresDefault "access plus 30 days"
ExpiresByType image/gif "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
ExpiresByType image/jpg "access plus 30 days"
ExpiresByType text/css "access plus 30 days"
ExpiresByType text/php "access plus 30 days"

#does fuck all , 500 internal service error
<Directory "/blog/">
AddHandler application/x-httpd-php .css
AddHandler application/x-httpd-php .js

php_flag zlib.output_compression On

Link to comment
Share on other sites

i got it working the dumb patchy way

RewriteEngine On

Options +FollowSymLinks

Options All -Indexes

RewriteBase /blog/

AddHandler text/css .css

AddHandler application/x-javascript .js


i put this in /blog/


still waiting for the right way using <directory> tho

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.