WordPress.org

Forums

[resolved] How to stop WordPress from editing .htaccess? (11 posts)

  1. Sam_a
    Member
    Posted 8 years ago #

    I've removed WordPress's Rewrite conditions from my site .htaccess but WordPress (2.0.7) seems to put them back in periodically. I haven't changed the blog or WordPress URL or the permalink structure.

    On my local server Apache runs as www and I can take away write access, but on this remote server Apache runs as me (the FTP user) so I don't know what to do.

  2. Set the permissions of it to 444? Then nobody can write to it.

    Anyway, without the .htaccess stuff, permalinks won't work. Why would you remove those from there?

  3. Sam_a
    Member
    Posted 8 years ago #

    I still need to write to .htaccess though. :)

    I'm still using pretty permalinks, but I'm using a modified set of Rewrite conditions to limit which requests WordPress should handle. WordPress doesn't overwrite these, but it adds the default conditions below, which nullifies what I'm trying to do.

    Thanks for the reply, Otto.

  4. If the server is running as you, then it has the same permissions you do. So deny yourself permissions to write to it or let the server keep writing to it. If you need to change it later, you can override the permissions back and change it, then deny yourself permissions again.

    But you can't have it both ways here. You and the server have the same identity, so you have the same permissions.

  5. Sam_a
    Member
    Posted 8 years ago #

    If I take away my own write access for the file, can I ever get it back? I thought I would need write access to make any further permission changes.

    The problem is not so much that the server has write permission but that WordPress in particular keeps writing to it... I guess I'll try to find the relevant WordPress code and comment it out. Not a great solution either.

    Thanks, Otto.

  6. If I take away my own write access for the file, can I ever get it back? I thought I would need write access to make any further permission changes.

    The permissions of the file entry is not the file itself. The owner of the file can always change permissions on it. You don't need write permissions to change permissions. That would be silly.

  7. Sam_a
    Member
    Posted 8 years ago #

    Oh, I was mixed up. If I were to change the file *owner* I'd never be able to get it back. So I'll try changing the write permissions. Thanks!

  8. armen52
    Member
    Posted 8 years ago #

    Sam, could you share how you edited your .htaccess file to limit the requests that WordPress handles? I have been trying to figure out how to have certain folders under my root not be considered permalinks or categories by WordPress and promptly 404'd.

    Thanks!

  9. tedgoas
    Member
    Posted 8 years ago #

    I had a similar problem and just 777'd my .htaccess. My permalinks now work. However, am I granting too much acccess and leaving my site open for outsiders?

  10. Sam_a
    Member
    Posted 8 years ago #

    I have been trying to figure out how to have certain folders under my root not be considered permalinks or categories by WordPress and promptly 404'd.

    Hi Armen, do you mean that you get WordPress's 404 page when you try to visit an existing directory? (like /images/ or something)

  11. I have been trying to figure out how to have certain folders under my root not be considered permalinks or categories by WordPress and promptly 404'd.

    If you look at the default .htaccess file it creates, there's a RewriteRule that ends with a -d. That rule prevents it from doing exactly what you're talking about. Existing directories will not get rewritten to WordPress.

    Unless you're trying to do something like password protect those directories, perhaps? This is a known issue with a solution. :)

Topic Closed

This topic has been closed to new replies.

About this Topic