WordPress.org

Ready to get started?Download WordPress

Forums

htaccess in wrong place (3 posts)

  1. wpuk567
    Member
    Posted 6 years ago #

    Hello everybody -

    I wonder if anybody could point me in the right direction please.

    Just set my first self-hosted WP site up. Everything is working great.

    However, just installed and run WP-Security which tells me "The file .htaccess does not exist in wp-admin/. "

    On checking I find yes, I have for some reason put my .htaccess file in the root of my website, not inside the 'wordpress' directory. My file structure on the hosted website is: root, then a 'Wordpress' directory, and everything to do with WP is inside this directrory. My .htaccess is outside the 'Wordpress' folder.

    I realise now this is wrong. However, when I move the .htacess file to my wordpress/wp-admin folder, I get various 404 errors (pages that were coming up fine before the .htaccess move now can't appear). If I move the .htaccess file back to the root, everything on the site is fine again.

    This is a little beyond my very limited knowledge of htaccess, unix, etc. so I wonder if anybody could point me a step-by-step instruction sheet for moving my .htaccess to eliminate this security risk spotted by WP-Security plugin.

    For info, my htaccess file looks like this (I have no idea what it means, it was created for me when I set my permalinks up and the screen told me to create one - at the time I did this I had no idea it needed to go into the wp-admin folder):-

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    That's it. Thanks in advance

  2. sailboatvn
    Member
    Posted 6 years ago #

    You need to put your .htaccess file under wordpress folder and change its content as below:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . wordpress/index.php [L]
    </IfModule>

    or might be

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    Cheers,

    [sig moderated]

  3. wpuk567
    Member
    Posted 6 years ago #

    Cheers Dave, thank you for the quick response - I'll give both those a go a bit later on and let you know the outcome. Thank you for the kind help.

Topic Closed

This topic has been closed to new replies.

About this Topic