Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WordPress Permalink已更改,可以';无法访问网页_Wordpress_Amazon Ec2 - Fatal编程技术网

WordPress Permalink已更改,可以';无法访问网页

WordPress Permalink已更改,可以';无法访问网页,wordpress,amazon-ec2,Wordpress,Amazon Ec2,在我的WordPress3.5.2网站的前端,我有三个按钮:主页、博客和示例页面。当我的永久链接设置设置为默认值时,我可以访问以下三个页面: 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

在我的WordPress3.5.2网站的前端,我有三个按钮:主页、博客和示例页面。当我的永久链接设置设置为默认值时,我可以访问以下三个页面:

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
但是,当我将Permalink设置更改为
帖子名称并刷新浏览器时,我无法访问博客页面和示例页面。我收到以下错误:

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
中,我还收到以下消息:

如果您的.htaccess文件是可写的,我们可以自动执行此操作,但事实并非如此。这些是您在.htaccess文件中应该具有的mod_重写规则。在字段中单击并按CTRL+a选择全部。

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

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

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”发现了这一点,它可能会有所帮助:

在Wordpress安装的根目录下创建一个.htaccess文件。然后添加以下内容-

# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
#开始WordPress
重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress

如果您希望Wordpress自动执行此操作,请使用
chmod

+1将文件权限更改为777谢谢您的回复。我按照您提供的链接中的说明重新启动了httpd。不幸的是,它没有起作用。+1非常感谢你,菲尔。我重新阅读了说明书,显然我错过了第二步。它正在工作!不要忘记重置httpd:服务httpd重启
# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress