Order of codes in htaccess file
-
Hi there,
I am new in htaccess coding. I was trying to make changes for htaccess files to stop hotlinking and the spam referrals but when i put in the code it results in the 500 error page.
I am not sure what is wrong but I added the codes in htaccess before #end wordpress line.# 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>#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https://mydomain.com.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|png|bmp)$ [NC, F, L]# block referer spam
RewriteEngine On
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} server20\.openfrost\.com [NC, OR]
RewriteCond %{HTTP_REFERER} server12\.openfrost\.com [NC, OR]
RewriteCond %{HTTP_REFERER} buttons\-for\-website\.com [NC, OR]
RewriteCond %{HTTP_REFERER} www9\.openfrost\.com [NC, OR]
RewriteCond %{HTTP_REFERER} semalt\.semalt\.com [NC]
RewriteRule ^.* – [F,L]# END WordPress
Is it correct or I missed something.
Also just curious, I don’t know why”” # Options +FollowSymlinks “”is used for??
A little help would be really great.
- The topic ‘Order of codes in htaccess file’ is closed to new replies.