我在另一篇帖子上看到了这个问题,但由于我的声誉太低,无法添加答案。所以我想我会创建一个新线程。
因此,我将网站从草稿服务器迁移到了实时服务器<我从草稿服务器复制了网站文件夹并粘贴到live服务器中
我在另一篇帖子上看到了这个问题,但由于我的声誉太低,无法添加答案。所以我想我会创建一个新线程。
因此,我将网站从草稿服务器迁移到了实时服务器<我从草稿服务器复制了网站文件夹并粘贴到live服务器中
对于可能会出现的人:除了建议的答案之外,您还可以使用。web根目录中的htaccess文件。由于它们是linux系统上的隐藏文件,因此经常会被忽略。您可以检查并确保已复制该文件,或者创建一个新文件并将重写规则粘贴到其中。这是我的一个例子。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
这就是解决方案
转到ftp或文件管理器查找。htaccess文件
Next: Change the code inside file (Look for RewriteBase line)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase / ("this line should be only a slash after RewriteBase - remove anything else")
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
这应该可以解决问题。-贾斯汀我一直在尝试:$mydb=新的wpdb(SQL数据库信息);是否有方法检查数据库连接是否已建立?它似乎不起作用,因为$mydb->get\\u results(query)没有返回任何内容,但我没有收到任何错误,所以我不知道出了什么问题。