▲Welcome to visit www.heteamo.com
2017-10-22 16:58
-
使用域名訪問wordpress網站的設置:
比如我的站點,輸入heteamo.com或者www.heteamo.com就可以訪問,而且把wordpress隱藏了。開始時,網站在工信部和騰訊雲的備案都通過了,但是輸入網址並不能訪問:
我是通過在騰訊雲的控制檯提交工單弄好的(必須贊一下騰訊的處理速度)。輸入heteamo.com可以訪問,但是出來的是Apache的testing頁面,好了,證明網址是正常解析的。-
登錄騰訊雲服務器,把wordpress文件夾裏的index.php複製到html文件夾下:
[root@VM_150_100_centos ~]# cd /var/www/html/wordpress #定位到wordpress文件夾下 [root@VM_150_100_centos wordpress]# ls -a #列出wordpress文件夾下所有的文件 [root@VM_150_100_centos wordpress]# mv index.php ../ #將index.php複製到html文件夾下 [root@VM_150_100_centos wordpress]# cd .. #回到html文件夾 [root@VM_150_100_centos wordpress]# ls -a #看下有沒有複製成功
-
修改剛纔複製到html文件夾下的index.php文件:
[root@VM_150_100_centos wordpress]# vi index.php #編輯index.php
找到 require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );並將其改成require( dirname( __FILE__ ) . 'wordpress/wp-blog-header.php' );
-
登錄wordpress後臺,設置 –>> 常規,修改 站點地址(URL):http://heteamo.com(就是把原來後面的/wordpress/去掉)
至此,再用heteamo.com和www.heteamo.com都能訪問網站了。但是這個方法只適合apache中只有一個網站的情況,也就是說/var/www/html/文件夾下只有一個index.php。
-
登錄騰訊雲服務器,把wordpress文件夾裏的index.php複製到html文件夾下:
-
更改網站固定鏈接後出現error 404:
這是中文encode/decode的問題,把固定鏈接改成樸素就好了。 -
底部添加版權信息和備案:
添加© copyright 建站年份-現在年份.All Rights Reserved. 外觀 –>> 編輯 –>> function.php最下方添加代碼:
在footer.php中版權顯示的位置添加(備案號在設置 –>> 常規 ->> ICP備案號中填)function copyright_display($start, $owner) { $date = date('Y'); echo "© Copyright "; if ( $start < $date ) { echo "{$start} - "; } echo "{$date} {$owner}"; }
<?php copyright_display('2017', '<a href="http://heteamo.com">heteamo.com </a>'); ?> . All Rights Reserved. | <a href="http://www.miitbeian.gov.cn/" rel="external nofollow" target="_blank"><?php echo get_option( 'zh_cn_l10n_icp_num' );?></a>
-
新發現:
- Kindeditor For Wordpress:一款編輯器,挺好用的。
- 幾款好看的主題:Colorlib的Sparkling和Activello(良心網站,主題都好看)、知更鳥的begin、Github上發現的Snap。