• Hi, I found two “.htaccess” files, one is located in ‘/httpdocs/.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

    Another one is located in ‘/httpdocs/wordpress/.htaccess’:

    # BEGIN Better WP Security
    # Begin HackRepair.com Blacklist
    RewriteEngine on
    #Block comment spammers, bad bots and some proxies
    RewriteCond %{REMOTE_HOST} 12.226.240.248 [OR]
    RewriteCond %{REMOTE_HOST} 24.111.102.26 [OR]
    RewriteCond %{REMOTE_HOST} 24.117.121.113 [OR]
    RewriteCond %{REMOTE_HOST} 65.30.216.140 [OR]
    RewriteCond %{REMOTE_HOST} 67.87.64.23 [OR]
    RewriteCond %{REMOTE_HOST} 68.12.149.198 [OR]
    RewriteCond %{REMOTE_HOST} 69.139.167.203 [OR]
    RewriteCond %{REMOTE_HOST} 74.95.182.57 [OR]
    RewriteCond %{REMOTE_HOST} 91.121.3.29 [OR]
    RewriteCond %{REMOTE_HOST} 203.94.229.227 [OR]
    RewriteCond %{REMOTE_HOST} 208.96.122.142 [OR]
    RewriteCond %{REMOTE_HOST} 210.0.141.247 [OR]
    RewriteCond %{REMOTE_HOST} 210.197.97.67 [OR]
    ...

    The WordPress was installed on ‘/wordpress/’ dir, then never changed, but when users go to my site, the URL shows “http://www.mydomain.com&#8221;, 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

    It seems some plugins are using “wordpress/.htaccess”, but “/.htaccess” is also working, it is safe to keep working like that? How to fix this??

    Thanks!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can put a .htaccess file in every directory if you want, thought there is usually no need to do that.

    It looks like you have a subdirectory install, which should be fine.

    Are you having specific problems because of you setup?

    Thread Starter raymng

    (@raymng)

    Hi, thanks for your reply.

    I have no problem right now. But I just afraid that if some plugins are “using” one .htaccess file and some plugins are “using” another .htaccess file, that may mess up something later.

    What do you think? Anything I should pay attention to?

    Thanks!!

    Plugins don’t really use the .htaccess files directly. The server itself does. The exception being when a plugin writes to the file, as in your case. Anyway, .htaccess files cascade so in effect anything in “/wordpress/” is using both files, not just one of them. It should be fine. I wouldn’t worry unless you actually notice unexpected behavior.

    Thread Starter raymng

    (@raymng)

    Thanks. So anything outside ‘wordpress’ folder would use only the ‘/httpdocs/.htaccess’ file, right?

    Also, could you briefly tell what is the actual purpose of the ‘/httpdocs/.htaccess’ file?

    Thanks!

    Thanks. So anything outside ‘wordpress’ folder would use only the ‘/httpdocs/.htaccess’ file, right?

    Yes.

    The way you have the site setup you are cheating around the fact that the site isn’t really where it appears to be. In other words, it is at http://www.mydomain.com/wordpress instead of http://www.mydomain.com where it appears to be. You have to rewrite certain requests at root to make that happen.

    Thread Starter raymng

    (@raymng)

    Okay, thanks for your help!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Two “.htaccess” Files Located in Different Directories…’ is closed to new replies.