Home > CMS Tutorial > WordPress > body text

Solve the problem of wordpress's .htaccess automatically restoring to the default mode

藏色散人
Release: 2021-01-25 14:32:36
forward
2973 people have browsed it

The following column WordPress Tutorial will introduce to you the solution to automatically restore WordPress's .htaccess to the default mode. I hope it will be helpful to friends in need!

Solve the problem of wordpress's .htaccess automatically restoring to the default mode

.htaccess configuration file plays an important role. But I don’t know if you have noticed that the .htaccess file of WordPress is often changed. The changes I am talking about here do not mean that the website is hacked, or that the .htaccess is changed due to the installation of plug-ins, but that the .htaccess is unknowingly changed. Restore to default.

I tested it myself. As long as you click on Settings - Fixed Connection, no matter whether you have modified anything or not, and whether you have not saved it, as long as you click "Fixed Connection", .htaccess The content between #BEGIN WordPress and #END WordPress in the file will be changed and restored automatically. I don’t know if this is a WordPress bug.

The best solution to this problem is:

Add your own statement in .htaccess and write it in # BEGIN WordPress and # END Outside WordPress, as follows:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^ index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

RedirectRule 301 ^1.html $ 1.php

##

The above is the detailed content of Solve the problem of wordpress's .htaccess automatically restoring to the default mode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template