【发布时间】:2021-04-22 17:30:59
【问题描述】:
我刚刚将我的 wordpress 博客从 localhost 转移到 aws(amazon webservices)
我遵循的方法
1.database 从本地复制phpmyadmin
2.在新服务器上创建数据库并将旧服务器的sql导入新服务器的数据库中
3.set wp config file on new server username,password,databse name
4.在新数据库上设置 wp-options 表
更新siteurl,更新主页到网站url
5.复制所有wp文件并制作zip文件->通过filezilla ftp将zip文件移动到站点位置并在该位置解压缩
在此之后,wordpress 网站加载,所有页面和帖子都能正常工作,但样式缺失..
这是我的functions.php
function fastinfo_files(){
//css
//wp_enqueue_style('google-fonts','https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300;400;500;700&display=swap');
wp_enqueue_style('google-fonts','https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
wp_enqueue_style('google-fonts2','https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;800&display=swap');
wp_enqueue_style('google-fonts3','https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500&display=swap');
//wp_enqueue_style('bootstrap',get_stylesheet_uri().'/assets/css/bootstrap.css',array(),'4.0','all');
wp_enqueue_style('bootstrap',get_template_directory_uri().'/assets/css/bootstrap.css',array(),'4.0','all');
wp_enqueue_style('font-awesome','https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');
//wp_enqueue_style('font-awesome2','https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css');
wp_enqueue_style('slick-theme','https://cdn.jsdelivr.net/gh/kenwheeler/slick@1.8.1/slick/slick-theme.css');
wp_enqueue_style('slick-css','https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css');
wp_enqueue_style('custom',get_template_directory_uri().'/assets/css/style.css',array(),microtime(),'all');
wp_enqueue_style('fastinfo_main_styles',get_stylesheet_uri(),array(),microtime());
//js
wp_enqueue_script('jquery');
wp_enqueue_script('boot-popper','https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js');
wp_enqueue_script('boot-js','https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js');
wp_enqueue_script('fast-main-js',get_template_directory_uri().'./assets/js/main.js',array(),microtime(),true);
//wp_enqueue_script('fontawesome-js','https://kit.fontawesome.com/a076d05399.js');
//wp_enqueue_script('slick-js','https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js');
}
add_action('wp_enqueue_scripts','fastinfo_files');
我什至尝试注释掉 enqued css 并将 css 直接放在标题中 像这样
<!-- CSS here -->
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/assets/css/bootstrap.css">
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/assets/css/style.css">
<?php wp_head(); ?>
但这也没用
而且我无法访问 wp-admin 每次我尝试这样做时都会显示此错误
此页面无法正常工作www.xxxxxxxx.com 将您重定向了太多次。 尝试清除您的 cookie。
我之前按照相同的步骤将 wordpress 网站从本地镜像到 cpanel 托管,它的工作原理很吸引人,但由于我不知道 aws,我真的很困惑出了什么问题..
任何帮助将不胜感激,谢谢
【问题讨论】:
标签: php wordpress amazon-web-services