• Resolved simon

    (@simonp820)


    Hi,

    Looking forward to using (and promoting) this great plugin.

    First install – whenever I make any changes I get:

    Unable to write to your .htaccess or nginx.conf file. If the problem persists contact support.

    (although the changes do appear to be saved??)

    Can’t see anything in the readme or help docs – any ideas?

    Cheers!

    https://www.ads-software.com/plugins/better-wp-security/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Do you have WP Permalinks enabled ?

    dwinden

    Thread Starter simon

    (@simonp820)

    Hi dwinden,

    Yes, I do. Is that a problem?

    No, it should be enabled. Just making sure.

    If you have selected “Post name” type Permalinks make sure you have the following lines in the .htaccess file:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    If you have WordPress installed in a subfolder it will look a little bit different.
    Naturally you will need to have Apache mod_rewrite module loaded for this to work properly.

    I’ve been involved in a couple of other identical topics in this forum and haven’t yet been able to identify exactly what causes this issue.
    You may find the following topic an interesting read:

    https://www.ads-software.com/support/topic/unable-to-write-to-your-htaccess-or-nginxconf-file-3

    I’ve posted debug instructions in that topic but have yet to receive the result. So if you are up to the challenge … be my guest.

    dwinden

    Thread Starter simon

    (@simonp820)

    Hey dwinden – thanks for your reply.

    That pretty much what my .htaccess looks like:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>
    
    php_value memory_limit 128M

    I noticed in the other posts they mentioned iThemes stuff in the .htaccess file but I have none of that – so maybe the plugin *can’t* actually write to the file??

    I don’t have a debug_write.log file either?

    As I said it would look a little bit different if you have WordPress installed in a subfolder which you seem to have.

    Still I’m missing the following line:

    RewriteRule ^index\.php$ – [L]

    There also doesn’t seem to be any of these lines:

    # BEGIN WordPress
    # END WordPress

    So perhaps your current .htaccess is created\produced in the past by an older WP release …

    Just to make sure, this is not a multi-site WP install ?
    And you have Permalinks type set to “Post name” ?

    Perhaps you should make a copy of your current .htaccess file and then
    disable Permalinks (reset it to the default value).
    Then delete the current .htaccess file and let WP recreate it by setting Permalinks back to “Post name” type.
    Then post the full content of the new .htaccess file.

    About the iThemes stuff in the .htaccess file.
    That could indeed confirm that the plugin *can’t* actually write to the current .htaccess file. Try and get the .htaccess file recreated by WP Permalinks as described above.

    That said there is also a setting in the iTSec plugin that may prevent you from writing anything to the .htaccess file. But if that setting is not enabled you would receive other warnings\messages when attempting to save iTSec settings to the .htaccess file. So I don’t htink that is the case.

    The debug_write.log will only be produced if you download and use the debug copy of the class-itsec-files.php file which I modified and made available in the other topic to debug this issue.

    dwinden

    Thread Starter simon

    (@simonp820)

    Yep this is a very old installation that’s been upgraded many times ??

    I’ve changed the permissions of .htaccess to 666 and it all seems ok now.

    Ah … hihi … so I was overcomplicating things … haha
    Still I advise you to have the .htaccess regenerated by WP Permalinks.
    This way you are sure you are using the latest WP 4.1.1 RewriteRules
    for Permalinks in the .htaccess file.

    I just checked the 4.1.1 WP source code and the missing line I identified earlier should definately be in there …

    Anyway if my assistance helped you resolve the issue please mark this topic as ‘resolved’.

    dwinden

    Thread Starter simon

    (@simonp820)

    Yep I’ve regenerated the .htaccess and all looks good ??

    Thanks for your help dwinden.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Unable to write to your .htaccess or nginx.conf file. If the problem persists co’ is closed to new replies.