Title: htaccess problem
Last modified: August 19, 2016

---

# htaccess problem

 *  Resolved [leebolton](https://wordpress.org/support/users/leebolton/)
 * (@leebolton)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/)
 * Setting up a WP site on a server with a directory structure that I haven’t encountered
   before and having problems getting pretty permalinks working.
 * .htaccess file is in /var/www/htaccess
    wordpress files are in /var/www/html
 * I have added the standard rules to my htaccess file, i.e.
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
       ```
   
 * But all permalinks give 404 errors.
 * I’m guessing that the problem is somewhere around the RewriteRule but I cannot
   work out what it is – no doubt something simple!
 * Any help greatly appreciated.

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

 *  Thread Starter [leebolton](https://wordpress.org/support/users/leebolton/)
 * (@leebolton)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822247)
 * I should add that putting the .htaccess file in the same directory as the wordpress
   files totally screws things up and gives ‘mod_rewrite rule not allowed here’ 
   errors in the log.
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822256)
 * my htaccess is in the root of the WordPress and it works fine.
 * Check if the mod-rewrite in the server is enabled.
 * codex guide: [http://codex.wordpress.org/Using_Permalinks](http://codex.wordpress.org/Using_Permalinks)
 *  Thread Starter [leebolton](https://wordpress.org/support/users/leebolton/)
 * (@leebolton)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822262)
 * Thanks for the reply. Can confirm that mod-rewrite is located on the server.
 * All my other WP installations have .htaccess in the same directory as the wordpress
   install and work fine. First time I’ve seen this problem.
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822290)
 * If you have not already tried, try re-saving your permalink structure at Admin
   panel>>>Settings>>>Permalinks. WordPress either creates/amends the .htaccess 
   file for you or provides you with the correct block of code to manually add to
   your .htaccess file.
 *  Thread Starter [leebolton](https://wordpress.org/support/users/leebolton/)
 * (@leebolton)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822302)
 * Been through that several times too.
 * I think the problem is due to the directory structure on the server and that 
   the htaccess file is not allowed in the var/www/html directory where there wordpress
   index.php file is.
 * I’m guessing that something in .htaccess will need to be added/amended to compensate
   for this, but I have no idea what…
 *  Thread Starter [leebolton](https://wordpress.org/support/users/leebolton/)
 * (@leebolton)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822388)
 * Should also mention that I have the htaccess control plugin installed and it 
   is able to pick up my htaccess file.
 *  [MJ](https://wordpress.org/support/users/mardie/)
 * (@mardie)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822389)
 * Try setting your .htaccess’ permission to:
 * > .htaccess permissions
   > 644 > 604 – The bit allowing the group owner of the .htaccess file read permission
   > was removed. 644 is normally required and recommended for .htaccess files. 
   > [source](http://codex.wordpress.org/Changing_File_Permissions)
 *  Thread Starter [leebolton](https://wordpress.org/support/users/leebolton/)
 * (@leebolton)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822391)
 * Thanks for your reply – I already have the permissions set to 644.
 *  Thread Starter [leebolton](https://wordpress.org/support/users/leebolton/)
 * (@leebolton)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822416)
 * Think I have narrowed the problem down to this line:
 * `RewriteRule . /index.php [L]`
 * I think the mod_rewrite rules are not being applied because my htaccess is in
   var/www/htaccess and is not allowed in the root, var/www/html.
 * Still cannot work out how to get around it.
 *  Thread Starter [leebolton](https://wordpress.org/support/users/leebolton/)
 * (@leebolton)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822551)
 * Found a solution – web host changed permissions on the server so that .htaccess
   file is allowed in the web root directory.

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

The topic ‘htaccess problem’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 3 participants
 * Last reply from: [leebolton](https://wordpress.org/support/users/leebolton/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/htaccess-problem-12/#post-1822551)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
