简体   繁体   English

WordPress文件在localhost上看不到/〜username /

[英]WordPress files not seeing /~username/ on localhost

I have a localhost running on localhost/~frederoover/ , everything works perfect, but when I install a WordPress website, I'm getting the following issue's. 我有一个在localhost /〜frederoover /上运行的localhost ,一切正常,但是当我安装WordPress网站时,出现以下问题。

localhost/~frederoover/agri-travel.be loads just fine, but the internal files all give a 'Failed to load resource: the server responded with a status of 404 (Not Found)' and they are pointing to localhost/wp-content/plugins/* . localhost /〜frederoover / agri-travel.be可以很好地加载,但是内部文件都给出了“无法加载资源:服务器响应状态为404(未找到)”,并且它们指向localhost / wp-content / plugins / * So WordPress doesn't see my /~username/. 因此WordPress看不到我的/〜username /。

Any thoughts on how to solve this? 关于如何解决这个问题有什么想法吗?

在此处输入图片说明

Your site URL is incorrect. 您的网站网址不正确。 The easiest way to fix this to add this to your wp-config.php and load the home page: 解决此问题的最简单方法是将其添加到wp-config.php并加载主页:

define('RELOCATE', true);

Make sure to remove it after you are finished. 完成后,请确保将其删除。

Step 1: Export your database as .sql open the file using text editor. 步骤1:将数据库导出为.sql ,使用文本编辑器打开文件。 find the http://localhost and replace with http://localhost/~frederoover/sgri-travel.be and again import it. 找到http://localhost并替换为http://localhost/~frederoover/sgri-travel.be然后再次导入。 This will work.! 这将起作用。

Step 2: Update siteurl and home 第2步:更新siteurlhome

Next you need to change the location of your site in the database. 接下来,您需要更改站点在数据库中的位置。

In wp_options, locate siteurl and home. 在wp_options中,找到siteurl和home。 Usually these records are at the top of the table on line 1 and 2. For siteurl, click the field under option_value and replace the old domain with your new domain name ( http://localhost/~frederoover/sgri-travel.be in your case ). 通常,这些记录位于表1和2的表格顶部。对于siteurl,请单击option_value下的字段,然后将旧域替换为新域名( http://localhost/~frederoover/sgri-travel.be您的情况)。 Press enter to save. 按Enter保存。 Do the same for home. 在家做同样的事情。

Step 3: Fix permalinks (Optional) 步骤3:修复固定链接(可选)

If you experience that you get a 404 error when you try to open links on your site, the Permalinks are broken. 如果您在尝试打开网站上的链接时遇到404错误,则永久链接已损坏。 Luckily it is very easy to fix this. 幸运的是,解决此问题非常容易。

Log in to your WordPress dashboard. 登录到WordPress仪表板。 Click Settings and then Permalinks Scroll down and click Save Changes. 单击设置,然后永久链接向下滚动并单击保存更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM