• Something very strange happens.

    In the web vivepasionflamenca I am trying to change the file .htaccess and it is impossible. I tell you my steps:

    – I try to change it and I see it has 444 permissions. Only readable. Ok. I change the permissions with Filezilla.
    – I edit the .htaccess. Everything looks ok. The file edited is in its place.
    – When I make something in the web (for example, click on a link of the menu), suddenly the .htaccess is rewritten and again the first .htaccess with 444 permissions and the old content appear, replacing the edited one.

    I tried in local server, I tried deactivating all plugins, I tried with twenty sixteen theme instead of the current one. Nothing. The .htaccess is replaced with the 444 one when I make something in the web.

    Some idea please?

    Thanks a lot.

    This is the content of the .htaccess that I cannot change:

    # 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
Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please contact your host. If the file permissions are changing, it’s more than likely something they’re doing.

    Thread Starter Fernando Díaz Gascón

    (@ferchup)

    No, I duplicated the web in my computer, in localhost, and the problem is the same, so my conclusion is that the host is not the problem.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    the permissions are changing on your localhost site?

    WordPress only changes the .htaccess file when you set/reset your permalinks. You should not make any changes between the BEGIN and END WordPress comments; that part of .htaccess belongs to WordPress. If you want to make changes, put them before or after the WordPress block.

    Thread Starter Fernando Díaz Gascón

    (@ferchup)

    I know that. i try to explain with an example, to try to understand the problem. I know is weird:

    1- Initial situation: I have this .htaccess with only read permissions:

    # 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

    2- I change the permissions to be able to read and write the .htaccess.

    3- I go to Permalinks ->Post Name and I press “Save changes”. I check the .htaccess now and it has changed to this:

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

    4- I press to other place in my dashboard. For example, I go to see the posts, or whatever. Then, I check the .htaccess and ?surprise! It has changed and it is the same that in the step 1. I mean, with only read permissions and with this contain:

    # 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

    5- Conclusion: I cannot change the .htaccess file or before, or after or inside the #BEGIN – #END.

    It is the most strange thing I have seen in WordPress, but is real and it is happening in the hosting, in localhost, when I deactivate the plugins or when I change the theme to twenty sixteen.

    ??

    Thread Starter Fernando Díaz Gascón

    (@ferchup)

    Finally I re-install manually the wordpress core files and the problem was solved. Some way, some wordpress file was producing this strange situation. I dont know which file, but it is solved.

    If the problem was not in plugins or theme, this was the last possibility!!

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘I can't change htaccess’ is closed to new replies.