• Resolved The Business Physician

    (@the-business-physician)


    Attempting to configure WordFence v6.2.3 using “Click Here to configure” and getting message “We were unable to make changes to the .htaccess file” etc..

    So I manually edited the .htaccess and the .user.ini files, using exactly same wording/coding as found in another, identically organized, WordFence installation on another of my WP sites where it works perfectly.

    However, even though the 2 key files have been manually adjusted, WordFence still asks to be configured as if nothing has changed.

    Both WP installations use the same hosting platform (Unix Apache + suPHP).

    So why does one site work perfectly while the other does not?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi,
    This message indicates something wrong with “.htaccess” file permissions, it’s recommended to have (644) permissions for “.htaccess” as mentioned on WordPress codex page.

    Also, make sure you set the correct owner/group for this file based on your server configuration (www-data:www-data for Apache server by default) you may need to check this with your web host.

    Finally, are you able to use any other permalinks settings than the default WordPress structure? I just want to make sure WordPress can write to this file too.

    Thanks.

    I have a VPS with about 20 WP installs all running WF – but one – just one comes up with We were unable to make changes to the .htaccess file.

    I have checked permissions 644 – deleted and recreated the htaccess file and still can’t get the optimisation to run – there are no other security plugin running on this site https://www.wollongonghomeloans.com.au/

    Sorry forgot to mention that I also recreated the file as local user and I deactivated all other plugins

    Hi @keychange
    Are you able to use any other permalinks settings than the default WordPress structure? I just want to make sure WordPress can write to this file too.

    Also, I suggest confirming with your web host that the web server user can write to this .htaccess file correctly.

    P.S. for future questions, please open a separate support thread, replying to other users’ threads isn’t recommended.

    Thanks.

    Thread Starter The Business Physician

    (@the-business-physician)

    Hi @wfalaa
    Thank you for responding.

    Unfortunately, your answer does not help directly because:

    1) “This message indicates something wrong with “.htaccess” file permissions, it’s recommended to have (644) permissions for “.htaccess” as mentioned on WordPress codex page.” -> Agreed: However, file permissions are set to 644 and, as logged in, I AM the “Owner” and “Admin” of this system.

    However, ?? it has helped indirectly because it made me go back once more and look at what/how I had edited the respective .htaccess and .user.ini files.

    I discovered that I had inadvertently included the wrong sub-folder in the text string of the URL to reference the autoprepend of the wordfence-waf.php file in the .user.ini file.

    Having now corrected this error, it appears that Wordfence is finally doing what it is supposed to do. My bad!

    Thank you very much for a great plugin. /psb

    ps: Of course, this still does not answer why Wordfence could not auto-configure this particular installation but the manual edit certainly seems to have solved the problem. Perhaps it has something to do with not using /wordpress/ in the first place as the sub-folder for this installation?

    • This reply was modified 8 years, 3 months ago by The Business Physician. Reason: Add additional information re problem resolution
    Thread Starter The Business Physician

    (@the-business-physician)

    Hi @keychange
    Check out my reply to @wfalaa.

    If you are not using /wordpress/ as the sub-folder into which you are installing a WordPress site, then perhaps, like me, you have inadvertently incorrectly edited your .user.ini file ( or even your .htaccess file) within your WP install sub-folder. This is a very easy mistake to make and not always easy to spot.

    HTH? /psb

    Hi @the-business-physician
    I’m glad you managed to get this one sorted out!

    Just a couple of questions that would help me understand what was the problem:
    – Did you move WordPress installation files into a sub-directory following this guide?
    – Was that before or after installing Wordfence?

    Thanks.

    • This reply was modified 8 years, 3 months ago by wfalaa.

    Hi

    Sorry didn’t mean to hijack the post – I gave up and deleted the install – removed the entire domain from my VPS and recreated then restored from back ups and all is good.

    Thread Starter The Business Physician

    (@the-business-physician)

    Hi @wfalaa
    “– Did you move WordPress installation files into a sub-directory following this guide?” NO, I did not do that.

    1) I installed this copy of the WordPress application directly into this particular sub-directory from the outset. However, I did subsequently change the name of that sub-directory but that happened long before I introduced Wordfence and I had previously opened the relevant WP MySQL table to ensure that all related entries where brought into sync with that change.

    2) Under this particular website domain, I had already installed WordPress once into the conventional /wordpress/ sub-directory to use as the conventional blogging channel of this website. Wordfence installed perfectly, and automatically configured, there.

    3) Subsequently, I realised that I could also use the WordPress application to support another feature that I wanted to include in this website. This second installation, then, was the installation with which I had been experiencing difficulties in getting Wordfence to set up properly and is the one referred to in 1) above.

    4) While I could not get Wordfence to automatically configure in this secondary WordPress installation as in “1)” above – which was the original cause for me posting this question here – once I subsequently realised that I had incorrectly edited the related .user.ini file and fixed that, this Wordfence installation is also now working perfectly. And as previously stated above, the related file permissions where all already appropriately set to allow for auto-editing so not sure why that did not happen but nonetheless, manually (correctly ?? ) editing the files took care of that problem.

    Lastly ….
    “– Was that before or after installing Wordfence?” Wordfence was installed long – by weeks – after the original installation and sub-directory name change of this secondary WordPress installation.

    Thank you for a great program.

    HTH? /psb

    Thread Starter The Business Physician

    (@the-business-physician)

    Hi @keychange
    Glad to learn that you were able to resolve your own installation issues. Thank you for sharing your experience with me. /psb

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘We were unable to make changes to the .htaccess file’ is closed to new replies.