Support » Fixing WordPress » Adding rules to the ‘WordPress’ section in .htaccess

  • I have a domain alias pointing to my main website. In order for certain URLs for this alias to redirect properly I need to add a couple of rules to the # BEGIN WordPress … # END WordPress section of .htaccess.

    I am aware that these changes could get overwritten by WordPress and note the comment that this section should only be modified via WordPress filters. Could someone give me some advice on which filter I should use to achieve this.

    • This topic was modified 2 months, 2 weeks ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 1 replies (of 1 total)
  • If it was me, I’d try adding my new rules before the WordPress section to see if they work there first.

    If you find you need to add them to the actual WordPress section then keep a backup copy of the modified htaccess handy just incase WordPress should need to rewrite that later. That situation would probably most likely be during a WordPress update.

    And, if you change the htaccess file permissions to a more restrictive state (on Xnix anyway), the update/changes won’t write so I believe you’ll get a warning and directions to update that yourself with what WordPress thinks you should have in that section.

    I can’t address your question about hooks and such.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.