Home >CMS Tutorial >WordPress >How to remove /wordpress from WordPress path
When we put the WordPress program in the root directory of the space in the form of a folder for the website we built, we need to add the folder name when accessing, and the access address is: http://xxx/wordpress, it cannot be accessed directly using the domain name. Solution:
First, change the "index.php" in the program (in "/www/wwwroot/wordpress") Copy a copy to the root directory of the website (/var/www/html), and then open it. The default format is as follows:
require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
In fact, we only need to add the name of the folder where you store the program to the path. :
require( dirname( __FILE__ ) . './wordpress/wp-blog-header.php' );
After saving, you can open the program by directly accessing your domain name
Go to the WordPress installation background, in the general settings, in the "Site Address (URL)" column, remove wordpress after the address, as follows:
Siteurl: http://xxx/wordpress Home: http://xxx
You're done, call it a day!
Recommended tutorial: WordPress tutorial
The above is the detailed content of How to remove /wordpress from WordPress path. For more information, please follow other related articles on the PHP Chinese website!