WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found two ".htaccess" files, one is located in '/httpdocs/.htaccess', another one is located in '/httpdocs/wordpress/.htaccess', the content is different, is it normal?

The Wordpress was installed on '/wordpress/' dir, then never changed, but when users go to my site, the URL shows "http://www.mydomain.com", no 'wordpress' shown on the URL.

Also, from Settings > General:

WordPress Address (URL): http://www.mydomain.com/wordpress

Site Address (URL): http://www.mydomain.com

share|improve this question
Hi you already asked this question as a comment on your other question today about .htaccess. You just need to delete one or just leave them there – Damien Aug 26 '12 at 16:16
But the contents of two files is not the same.. – RRN Aug 26 '12 at 16:36

In general, Apache will use the most specific .htaccess to the resource being requested. This means that, for accessing files in /httpdocs/wordpress/, /httpdocs/wordpress/.htaccess will be used. Access to /httpdocs/foo/ will use /httpdocs/foo/.htaccess and, if that doesn't exist, it will use /httpdocs/.htaccess.

If your document root is pointing to /httpdocs/wordpress/, then users will see http://www.example.com as your WordPress directory. Also, if your /httpdocs/.htaccess includes rewriting to hide the wordpress in your folder name, the same will happen.

share|improve this answer
This is the content from "wordpress/.htaccess", only used by BetterWPSecurity: # BEGIN Better WP Security # Begin HackRepair.com Blacklist RewriteEngine on #Block comment spammers, bad bots and some proxies RewriteCond %{REMOTE_HOST} [OR] RewriteCond %{REMOTE_HOST} [OR] RewriteCond %{REMOTE_HOST} [OR] RewriteCond %{REMOTE_HOST} [OR] RewriteCond %{REMOTE_HOST} [OR] RewriteCond %{REMOTE_HOST} [OR] RewriteCond %{REMOTE_HOST} [OR] ... – RRN Aug 27 '12 at 11:11
This is the content from "/.htaccess": # 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 – RRN Aug 27 '12 at 11:13
It seems some plugins are using "wordpress/.htaccess", but "/.htaccess" is also working, do you think it is safe to keep working like that? Thanks. – RRN Aug 27 '12 at 11:19
As lacqui mentioned in his answer, Apache will get what ever it needs from all .htaccesses that you create but those that are more specific will overrule those closer to the root directory. This means you can have your rules split over multiple files. Or even shorter: Yes its ok to keep it that way. – Jan Beck Aug 28 '12 at 15:16

Looks to me like you have WordPress installed in a subdirectory. There is an in-depth explanation about that in the codex: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Step 7 mentions that the .htaccess file should be copied and not moved from the subdirectory to the root. So yes, having two .htaccess files is normal when you have set up your WordPress installation in a subdirectory.

share|improve this answer
But the contents is not the same, please check the contents in another comments on this page. Thanks. – RRN Aug 27 '12 at 11:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.