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
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 seehttp://www.example.com
as your WordPress directory. Also, if your/httpdocs/.htaccess
includes rewriting to hide thewordpress
in your folder name, the same will happen.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.