wordpress   发布时间:2022-05-06  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了WordPress建站技巧:将程序放在自定义目录中大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

很多站长朋友在使用wordpress建站的过程中,不想把整套网站程序放在根目录,而是想放在某文件夹中。这篇wordpress教程里,我们就向大家介绍一下方法,实现的步骤如下:

1. 创建文件夹(例如wordpress),用来放置WordPress程序
2. 到后台中的基础设置中,在wordpress address (URL)选项中输入WordPress程序所在的文件夹,如 http://example.com/wordpress,在Site address (URL)选项中填写wordpress根目录对应的链接,如 http://example.com,保存更改(忽略前台的一些错误信息,例如文件不存在等错误信息)。
3. 将WordPress程序移动到第一步创建的文件夹中。
4. 将index.PHP 和 .htaccess 文件拷贝到更目录(注意是拷贝,不要移动),.htaccess 是隐藏文件,所以要在FTP客户端中设置显示隐藏文件。打开根目录下的index.PHP文件,将以下代码

Crayon-5c891cf8b57d4263912781" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-setTings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-setTings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">675_37@
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-setTings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891cf8b57d4263912781-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891cf8b57d4263912781-1">Crayon-e">requireCrayon-sy">(Crayon-h"> Crayon-e">dirnameCrayon-sy">(Crayon-h"> Crayon-v">__FILE_Crayon-sy">_Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">.Crayon-h"> Crayon-s">'/wp-blog-header.PHP'Crayon-h"> Crayon-sy">)Crayon-sy">;

更改为:

Crayon-5c891cf8b57dd866082582" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-setTings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-setTings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">675_37@
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-setTings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891cf8b57dd866082582-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891cf8b57dd866082582-1">Crayon-e">requireCrayon-sy">(Crayon-h"> Crayon-e">dirnameCrayon-sy">(Crayon-h"> Crayon-v">__FILE_Crayon-sy">_Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">.Crayon-h"> Crayon-s">'/wordpress/wp-blog-header.PHP'Crayon-h"> Crayon-sy">)Crayon-sy">;

5. 登录wordpress后台地址 http://example.com/wordpress/wp-admin/

6. 如果您已开启静态链接,请到后台的设置中,更新静态链接wordpress自动更新.htaccess文件,如果权限不够,您需要手动更新.htaccess文件,将后台显示的重写规则拷贝到.htaccess文件中保存即可。

7. 搞定。

大佬总结

以上是大佬教程为你收集整理的WordPress建站技巧:将程序放在自定义目录中全部内容,希望文章能够帮你解决WordPress建站技巧:将程序放在自定义目录中所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:子目录