后台实现伪静态具体步骤
1、wordpress设置
![](https://i-blog.csdnimg.cn/blog_migrate/914eb40bac6514735d65dc38467dc882.png)
2、blog网页配置文件
1)修改03_blog.conf
![](https://i-blog.csdnimg.cn/blog_migrate/76cd41989cc6947e6a5fbd58c73a50f7.png)
[root@web02 /application/nginx/html/blog]#cat /application/nginx/conf/extra/03_blog.conf
server {
listen 80;
server_name blog.etiantian.org;
root html/blog;
location / {
index index.php index.html index.htm;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
location ~ .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi.conf;
}
}
2)在/application/nginx/html/blog目录下备份index.html
默认访问index.html,咋们做mv备份处理**
[root@web02 /application/nginx/html/blog]#cat index.html
blog.etiantian.org
[root@web02 /application/nginx/html/blog]#mv index.html index.html_backup
[root@web02 /application/nginx/html/blog]#ls
index.html_backup readme.html wp-activate.php wp-comments-post.php wp-content wp-links-opml.php wp-mail.php wp-trackback.php
index.php test_info.php wp-admin wp-config.php wp-cron.php wp-load.php wp-settings.php xmlrpc.php
license.txt test_mysql.php wp-blog-header.php wp-config-sample.php wp-includes wp-login.php wp-signup.php
3)index.php配置文件
[root@web02 /application/nginx/html/blog]#cat index.php
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
4)浏览器操作
![](https://i-blog.csdnimg.cn/blog_migrate/478cba08d348c23382d793b697ff8224.png)
5)地址解析结果
![](https://i-blog.csdnimg.cn/blog_migrate/e9a6f7dca27f198a59c0ece28ae0f3e6.png)
3、数据库查看
#用户密码登录
[root@web02 ~]#mysql -uroot -poldboy123
#进入具体数据库
oldboy [(none)]>use wordpress;
#显示表
oldboy [wordpress]>show tables;
#查看数据
oldboy [wordpress]>select * from wp_posts\G;
#退出数据库
oldboy [wordpress]>quit;
4、总结
![](https://i-blog.csdnimg.cn/blog_migrate/d07ff93760f5efc92f83296c74ac7d1f.png)