Title: htaccess in wrong place
Last modified: August 19, 2016

---

# htaccess in wrong place

 *  [wpuk567](https://wordpress.org/support/users/wpuk567/)
 * (@wpuk567)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/htaccess-in-wrong-place/)
 * 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

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [sailboatvn](https://wordpress.org/support/users/sailboatvn/)
 * (@sailboatvn)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/htaccess-in-wrong-place/#post-831350)
 * 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]
 *  Thread Starter [wpuk567](https://wordpress.org/support/users/wpuk567/)
 * (@wpuk567)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/htaccess-in-wrong-place/#post-831353)
 * 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.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘htaccess in wrong place’ is closed to new replies.

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [wpuk567](https://wordpress.org/support/users/wpuk567/)
 * Last activity: [17 years, 9 months ago](https://wordpress.org/support/topic/htaccess-in-wrong-place/#post-831353)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
