HTACCESS File Help - Gibberish

0 replies
I am not sure if i wrote my .HTACCESS file correctly. I have wordpress 3.5.1 and apache server. What i want to do is a simple redirect, block bad bots, and prevent hotlinking of images.

Here is my current file:

# BEGIN WordPress Redirect
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
# END WordPress Redirect
</IfModule>

# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
# END W3TC Browser Cache

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress


RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?.domain.com.*$ [NC]
RewriteRule .* - [F,L]

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]

----
Is this correct? Thanks guys!
#file #gibberish #htaccess

Trending Topics