After setting a custom fixed link in the WordPress backend, the front page cannot be displayed, prompting a 404 error page, but the original default dynamic path can still be opened. Why is this?
Analysis:
Generally when we use open source programs, such as WORDPRESS, we will first debug locally and upload some data. As mentioned in the title, when debugging on this site It has happened before. I checked some information and came to the conclusion:
The biggest possibility is that there is a problem with the configuration of apache (PHP server). After setting a custom fixed link in the background, it is equivalent to customizing the pseudo-static rules of the site. Then during the debugging process, your server environment must support pseudo-static before you can open the static path. Generally, you can If you configure the fixed path in the background, then your server environment will generally have no problems. The dynamic path can also be turned on, which means that there will be no problems with database connection and permissions. The problem usually lies in that you have not turned on Apache. Support pseudo-static function, how to implement it? Prerequisite: You are using the Apache server. First find the path where Apache is installed. There is a file called
"httpd.conf" in the "conf folder" in its root directory. Open it with Notepad. Press the "ctrl F" key to pop up the search window, enter:
"mod_rewrite" module. If it cannot be found, try to enter again:
" and change "AllowOverride None" to "AllowOverride all", which is To be on the safe side,
You can also search for "AllowOverride None" again. It may appear in multiple places, replace them all with "AllowOverride all", and then save the file.
Next, restart the apache server, go to the background to save the "fixed link", and reopen the page to see if it can be opened.
If you are not an Apache server, but use IIS for debugging, you have to install an "ISAPI_Rewrite3_0069_Lite.msi" filter, and then set PHP as a priority in the site settings.
wordpress tutorial column to learn!
The above is the detailed content of Why does wordpress get a 404 error?. For more information, please follow other related articles on the PHP Chinese website!