Ant*_*ony 3 wordpress amazon-ec2
在我的WordPress 3.5.2网站的前端,我有三个按钮:Home,Blog和Sample Page.当我的永久链接设置设置为时Default,我可以访问这三个页面:
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
Run Code Online (Sandbox Code Playgroud)
但是,当我将永久链接设置更改为Post name并刷新浏览器时,我无法访问"博客"页面和"样本"页面.我收到以下错误:
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.
Run Code Online (Sandbox Code Playgroud)
在WordPress中Settings -> Permalink Settings,我也收到此消息:
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)
[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
Run Code Online (Sandbox Code Playgroud)
将固定链接设置更改为后,我仍然可以访问我的主页Post name.我不确定这是否与我的问题有关,但我将我的WordPress站点安装在我的Amazon EC2微实例的子目录(xxx)中,我更改了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
Run Code Online (Sandbox Code Playgroud)
我通过谷歌搜索"permalinks htaccess amazon ec2"找到了这个,它可能有所帮助:http://guiem.info/permalinks-on-wordpress-amazon-ec2/
| 归档时间: |
|
| 查看次数: |
4228 次 |
| 最近记录: |