(I am aware that security via obscurity is not recommended).
I am trying to hide the fact that I am using Wordpress. This post is helpful, but it only addresses the content (sort of). I am interested in having the following occur:
User tries to access any url with
wp*
as a substring via their browser.Result: Redirected to 404 page.
Blog user/administrator knows in order to login they should go to
http://example.com/blogin/
.Result: apache redirects them to
http://example.com/wp-admin/
.If a user tries to directly access
wp-admin
from their browser they get sent to #1.Result: Redirected to 404 page.
Things I've done so far
I noticed for a default install of WordPress that I could access any of the
wp*
files in the (relative) root directory of the WP install. Specificallywp-settings.php
was problematic because it gave away information about my set-up. If a user accessed it, it would spew some PHP errors and reveal part of the directory structure. I edited my php.ini file to turndisplay_errors
off. Now accessinghttp://example.com/wp-settngs.php
brings up a blank page.This in itself isn't ideal because it reveals that
wp-settings.php
exists. In fact, accessing all the differentwp*
files is possible (with different results). I then put the following in my htaccess file:RewriteEngine On RewriteBase / RewriteCond %{PATH_INFO} wp* [NC] RewriteRule .* - [F]
This worked great! Anything with a
wp*
was routed to my custom 404 page. But now I can't access my admin page.I tried to insert this line into the above code:
RewriteRule ^blogin wp-admin [NC,R,L]
. It was supposed to be right afterRewriteBase
but this didn't work.I tried to do a:
<Directory /home/example/wp*> Order Allow, Deny Allow from example.com Deny from all </Directory>
hoping that a referer from my site (via the rewrite of the rule) would be able to access wp-admin, but not someone from outside. This didn't work either. apache complained that you can't use this directive from htaccess.
I've read the apache documentation; I understand the concepts, theoretically, but I need some practical help.
EDIT: I'm looking for a solution that uses .htaccess instead of httpd.conf since my particular setup makes using httpd.conf inconsistent.