文章最后更新时间:
只适合Windows本地环境(服务器上没试过),默认phpStudy2018 Nginx并不支持WordPress自定义链接,可以通过修改配置文件支持让其支持。文章源自奇客源码-https://www.qkget.cn/1711.html
用文本编辑工具打开PHPTutorial\nginx\conf目录的nginx.conf文件,修改前做个备份,以免修改失误,造成phpStudy无法启动。文章源自奇客源码-https://www.qkget.cn/1711.html
搜索autoindex on,找到类似:文章源自奇客源码-https://www.qkget.cn/1711.html
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
root "I:/phpStudy/PHPTutorial/WWW";
location / {
index index.html index.htm index.php l.php;
autoindex on;
}在其下面添加设置代码,有两种情况:文章源自奇客源码-https://www.qkget.cn/1711.html
一、WordPress程序直接安装在PHPTutorial\WWW目录中:文章源自奇客源码-https://www.qkget.cn/1711.html
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;
}二、WordPress程序安装在PHPTutorial\WWW子目录中,比如:wordpress:文章源自奇客源码-https://www.qkget.cn/1711.html
if (-f $request_filename/wordpress/index.html){
rewrite (.*) $1/wordpress/index.html break;
}
if (-f $request_filename/wordpress/index.php){
rewrite (.*) $1/wordpress/index.php;
}
if (!-f $request_filename){
rewrite (.*) /wordpress/index.php;
}修改其中的wordpress为你子目录名称。文章源自奇客源码-https://www.qkget.cn/1711.html
最后重启phpStudy,试试设置自定义链接是否可以打开了。文章源自奇客源码-https://www.qkget.cn/1711.html
phpStudy 最新版本是8.0,此方法并未在此版本中试过。文章源自奇客源码-https://www.qkget.cn/1711.html
可以到官网下载适合的版本:https://www.xp.cn/download.html文章源自奇客源码-https://www.qkget.cn/1711.html
本文链接:
版权声明:知识共享署名-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)协议进行许可
本站资源仅供个人学习交流,转载时请以超链接形式标明文章原始出处,(如有侵权联系删除)











子比主题美化
精品源码资源

暂无评论内容