I’m unable to change .htaccess file for wordpress multisite

I tried to search this question, but I haven’t found the solution. So just want to ask here.

It’s very strange that when I manually changed .htaccess file for WordPress multisite as below via SSH on my server, the file will automatically changed back to the default content if I refresh the website in the browser.

I just used vi .htaccess SSH command to modify it, after I modified, I did nothing changed in WordPress admin and I tried to deactivate all the plugin.

The permission of .htaccess is 644.

I don’t know the reason. It would be appreciated if you can give me some help.

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
RewriteRule . index.php [L]

After I refresh the homepage, it will changed back to

# 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


Source: .htaccess

Leave a Reply