Title: Which htaccess?
Last modified: August 18, 2016

---

# Which htaccess?

 *  [mark_l_sanders](https://wordpress.org/support/users/mark_l_sanders/)
 * (@mark_l_sanders)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/which-htaccess/)
 * I’ve got a relatively new WP site using 2.0.2; it was using PermaLinks without
   a problem. The Rewrite Rules were in .htaccess.php in the WP root.
 * I then needed to restrict access, so I wrote my own .htacess with the required
   rules and dropped it in the root.
 * Immediately, the permalinks stopped working!!! I’ve now switched off permalinks,
   so everything works, but: how can I resurrect permalinks AND retain my restriction.
 * When I tried to simply delete the new .htaccess, the permalinks were still broken.
   When I tried to restrict access by writing rules in the .htaccess.php file, the
   restriction did NOT work.
 * Is it the case that the .htaccess.php file is ONLY used if there’s no other .
   htacess file in the directory?
 * Can anyone help, or point me to a resource that makes this clear?
 * By the way, is 666 the appropriate chmod setting for the .htacess file(s) so 
   WP can update them automatically??
 * Also (sorry!!), as long as posts have slugs, can I turn permalinks on/off/on/
   off etc as often as I like?
 * thanks

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

 *  [Cypher](https://wordpress.org/support/users/cypher/)
 * (@cypher)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/which-htaccess/#post-365901)
 * Make your custom additions to the .htaccess file outside the #BEGIN/#END WordPress
   section.
 * That particular section is ‘managed’ by WP. It should ignore anything that’s 
   outside there. And as long as you are using the correct syntax in the .htaccess
   file, you should be good.
 * Regards
 *  Thread Starter [mark_l_sanders](https://wordpress.org/support/users/mark_l_sanders/)
 * (@mark_l_sanders)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/which-htaccess/#post-366184)
 * But which file – is the .htaccess.php file the REAL htacess file, or simply a
   template…?
 *  Thread Starter [mark_l_sanders](https://wordpress.org/support/users/mark_l_sanders/)
 * (@mark_l_sanders)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/which-htaccess/#post-366186)
 * Sorted it by deleting the .htaccess.php, re-enabling permalinks and simply pasting
   the new htacess contents after my blocking code in .htacess.
    Now permalinks 
   AND blocking work…

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

The topic ‘Which htaccess?’ 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/)
 * 3 replies
 * 2 participants
 * Last reply from: [mark_l_sanders](https://wordpress.org/support/users/mark_l_sanders/)
 * Last activity: [20 years, 1 month ago](https://wordpress.org/support/topic/which-htaccess/#post-366186)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
