WordPress永久链接已更改

WordPress永久链接已更改

本文介绍了WordPress永久链接已更改,无法访问页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WordPress 3.5.2网站的前端,我有三个按钮:主页,博客和示例页面.当我的永久链接设置设置为Default时,我可以访问以下三个页面:

On the front end of my WordPress 3.5.2 site, I have three buttons: Home, Blog and Sample Page. When my Permalink Settings are set to Default, I can access these three pages:

Home: http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/

Blog: http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/?page_id=13

Sample Page:
http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/?page_id=2

但是,当我将永久链接设置"更改为Post name,并刷新浏览器时,我无法访问博客"页面和示例"页面.,我遇到以下错误:

However, when I changed my Permalink Settings to Post name, and refreshed the browser, I cannot access the Blog page and Sample page. I get the following errors:

Blog: http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/blog
Not Found
The requested URL /blog/ was not found on this server.

Sample Page:
http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/sample-page/
Not Found
The requested URL /sample-page/ was not found on this server.

在WordPress的Settings -> Permalink Settings中,我也收到此消息:

In WordPress's Settings -> Permalink Settings, I also get this message:

If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.

当我检查.htaccess文件的权限时,我得到了644,因此将其更改为666,消息消失了(我将其更改回644)

When I checked my permissions for the .htaccess file, I got 644, so I changed it to 666 and the message disappeared (I changed it back to 644)

[ec2-user@ip-xx-xxx-xxx-xx html]$ ls -l .htaccess
-rw-r--r-- 1 root root 258 Jul 25 21:49 .htaccess
[ec2-user@ip-xx-xxx-xxx-xx html]$ sudo chmod 666 .htaccess

将永久链接设置更改为Post name之后,我仍然可以访问我的主页.我不确定这是否与我的问题有关,但是我将WordPress网站安装在Amazon EC2微型实例的子目录(xxx)中,并且按如下所示更改了WP的常规设置:

I can still access my home page after changing the permalink settings to Post name. I'm not sure if this has anything to do with my problem but I installed my WordPress site in a subdirectory (xxx) on my Amazon EC2 micro instance and I changed WP's General Settings as follows:

WordPress Address (URL): http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/xxx

Site Address (URL): http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com

推荐答案

我通过谷歌搜索"permalinks htaccess amazon ec2"发现了这一点,它可能会有所帮助: http://guiem.info/permalinks-on-wordpress-amazon-ec2/

I found this by googling "permalinks htaccess amazon ec2", it might help: http://guiem.info/permalinks-on-wordpress-amazon-ec2/

这篇关于WordPress永久链接已更改,无法访问页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 06:55