2013-07-21 132 views
3

在我的WordPress 3.5.2站點的前端,我有三個按鈕:主頁,博客和示例頁面。當我的永久鏈接設置被設置爲Default,我可以訪問這三個頁面:WordPress Permalink更改,無法訪問頁面

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,並刷新瀏覽器,我無法訪問博客頁面和示例頁面。我收到以下錯誤:

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,我也得到這個消息:

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)

[[email protected] html]$ ls -l .htaccess 
-rw-r--r-- 1 root root 258 Jul 25 21:49 .htaccess 
[[email protected] html]$ sudo chmod 666 .htaccess 

我仍然可以訪問我的家庭p將固定鏈接設置更改爲Post name後的年齡。我不知道這有什麼與我的問題,但我對我的亞馬遜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 

回答

5

我發現這可以通過搜索「permalinks htaccess amazon ec2」,它可能有所幫助:http://guiem.info/permalinks-on-wordpress-amazon-ec2/

+0

+1謝謝您的回覆。我遵循您提供的鏈接中的說明並重新啓動httpd。不幸的是,它沒有奏效。 – Anthony

+1

+1非常感謝phil。我重讀了指示,顯然我錯過了第二步。它正在工作! – Anthony

+0

不要忘記重置httpd:service httpd restart – ivanacorovic

2

在Wordpress安裝的根目錄下創建一個.htaccess文件。如果你想的WordPress來自動執行

# BEGIN WordPress 

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

# END WordPress 

,然後使用chmod更改文件權限爲777 - 然後添加以下。

+0

+1謝謝您的回覆! – Anthony

+0

不客氣:) –