apache conf entry does not work but does in .htaccess [closed]

i am running:

Server version: Apache/2.2.15 (Unix)

i have a custom security conf file on a shared server.

i placed the following entry at the top of the file with no joy, and i also placed it at the bottom, also with no joy.

RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .(wp-comments-post|wp-login)\.php*
RewriteCond %{HTTP_REFERER} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) http://error.myworkdomain.com/index.html [F,L]

but it works in .htaccess.

ideas?

Answer

If the mod_rewrite works in a .htaccess then you should be able to put it in tags with the directory pointing to the dir which you used to put the .htaccess in.

Attribution
Source : Link , Question Author : socalheel , Answer Author : Some Linux Nerd

Leave a Comment