WordPress 根无法正常工作
WordPress root not working
我已将 WordPress 上传到服务器并设置了暂存子域 (staging.website
)。我可以毫无问题地登录和访问 WordPress 管理员(例如 staging.website.com/wp-admin/
)并且我可以毫无问题地创建和导航到页面(例如 staging.website.com/sample-page/
)
但是,如果我尝试访问根页面:
- staging.website.com
我被重定向到 website.com/php
- 404 not found
。
有没有人有什么想法?
谢谢
乔恩
您可能在将 wordpress 分配给您的子域之前安装了它。
检查设置 > 常规并更改 URL 以匹配您的子域
此外,如果您在安装后重新定位文件,您的 WP 路径可能会出现问题。
您可以尝试以下步骤:
1. Edit the wp-config.php file.
2. After the "define" statements (just before the comment line that says "That's all, stop editing!"), insert a new line, and type: define('RELOCATE',true);
3. Save your wp-config.php file.
4. Open a web browser and manually point it to wp-login.php on the new server. For example, if your new site is at http://www.yourdomainname.com, then type http://www.yourdomainname.com/wp-login.php into your browser's address bar.
5. Login as per normal.
6. Look in your web browser's address bar to verify that you have, indeed, logged in to the correct server. If this is the case, then in the Admin back-end, navigate to Settings > General and verify that both the address settings are correct. Remember to Save Changes.
7. Once this has been fixed, edit wp-config.php and either completely remove the line that you added (delete the whole line), comment it out (with //) or change the true value to false if you think it's likely you will be relocating again.
Note: When the RELOCATE flag is set to true, the Site URL will be automatically updated to whatever path you are using to access the login screen. This will get the admin section up and running on the new URL, but it will not correct any other part of the setup. Those you will still need to alter manually.
我已将 WordPress 上传到服务器并设置了暂存子域 (staging.website
)。我可以毫无问题地登录和访问 WordPress 管理员(例如 staging.website.com/wp-admin/
)并且我可以毫无问题地创建和导航到页面(例如 staging.website.com/sample-page/
)
但是,如果我尝试访问根页面:
- staging.website.com
我被重定向到 website.com/php
- 404 not found
。
有没有人有什么想法?
谢谢 乔恩
您可能在将 wordpress 分配给您的子域之前安装了它。 检查设置 > 常规并更改 URL 以匹配您的子域
此外,如果您在安装后重新定位文件,您的 WP 路径可能会出现问题。 您可以尝试以下步骤:
1. Edit the wp-config.php file.
2. After the "define" statements (just before the comment line that says "That's all, stop editing!"), insert a new line, and type: define('RELOCATE',true);
3. Save your wp-config.php file.
4. Open a web browser and manually point it to wp-login.php on the new server. For example, if your new site is at http://www.yourdomainname.com, then type http://www.yourdomainname.com/wp-login.php into your browser's address bar.
5. Login as per normal.
6. Look in your web browser's address bar to verify that you have, indeed, logged in to the correct server. If this is the case, then in the Admin back-end, navigate to Settings > General and verify that both the address settings are correct. Remember to Save Changes.
7. Once this has been fixed, edit wp-config.php and either completely remove the line that you added (delete the whole line), comment it out (with //) or change the true value to false if you think it's likely you will be relocating again.
Note: When the RELOCATE flag is set to true, the Site URL will be automatically updated to whatever path you are using to access the login screen. This will get the admin section up and running on the new URL, but it will not correct any other part of the setup. Those you will still need to alter manually.