Rewrite rules for renaming a directory (wordpress)


I’m totally new to server and rewrite stuff…
Wondering… Is there any way (in .htaccess file)to hide directory of wordpress eg wp-admin to another name so visitors won’t know the backend is wordpress based.

Have anyone of the master here tried this? Wish that you can share your knowledge here.

Thank you!


Well, to hide the fact that it’s WP, you’d have to remove their footer and, presumably, some info in the headers. THEN you could rename the wp-admin directory but to what end? That directory is password protected and that’s your protection against the curious (as well as the hackers).



you could just rename the wp-admin directory, but as dklynn points out it is password protected

thanks for the replies…

Although I know WP have done a lot of security, but hiding the the real directory / engine working behind will be even more secure. Besides, using a nicer URL is also one of my purpose.

Is there any way to rewrite anything in the url which contain “wp-” to nothing?

eg for directory:

eg for link:


Sure, that’s easy (but it may disable your WP):

RewriteEngine on
RewriteRule ^wp-([a-z]+)(/(.*))$ $1$2 [L]

I wasn’t sure whether you wanted to capture the file request, too, so I added the $2 atom.



Thanks DK,

I tried your way, and my WP won’t work correctly as you mentioned just now… I’m doing research all the while and found something like this:

 Options +FollowSymlinks
RewriteEngine on
RewriteRule ^blog/([0-9]+)-([a-z]+)$1-$2 [NC]

would be a neat trick, enabling anyone to access my blog archives by doing…

in their browser, and have it automagically transformed server-side into…

It tried to hide the real url in the browser and wondering how to use it in wordpress.

I’m trying with this by assuming user will access : (and at the background, they actually accessing

RewriteRule ^admin([a-z]+)(/(.*))$$1$2

Is there anything I missing, cause it is not working for me T.T


You’re switching gears and talking about something completely different.

Back to WP, though. Its config.php contains all the directory information for WP including the directory in which it’s located (in the case of your example, blog/). IMHO, if you mess with WP, you can easily disable the whole thing, i.e., don’t do it!

Personally, I do NOT like WP’s mod_rewrite as its intent is to capture and redirect EVERTHING that is sent to its directory and redirect to its index.php file which, in turn, parses it to determine what was requested. If you change the mod_rewrite (except to avoid blog/ totally), you will disable WP. That’s the price of using it.




Thanks for your detailed explanation to me. In this case, I think I’ll give up to work on the mod rewrite anymore…

Thanks very much!!!

there is a good tutorial on how to hide that you use wordpress as CMS here:


“How to hide” is simply NOT to use the external redirect OR the R=301 flag. It’s just not that difficult!