[英]wordpress permalink not working on aws serever
我正在從事wordpress項目。 但永久鏈接無法正常工作。 如果我將它們設置為默認值,則可以使用,但是當我將其設置為發布名稱時,它將出現404錯誤。
我的htaccess文件是:
# BEGIN W3TC CDN
<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
# END W3TC CDN
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
</IfModule>
# END W3TC Browser Cache
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
'幫我找出我的wordpress的問題所在。
謝謝
我已經設法解決了這個錯誤。 此處的文檔列出了使Wordpress在AWS上正常運行所需的所有更改的清單-包括正確獲取權限: http ://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html
您需要修復的永久鏈接是tp 更新httpd.conf文件
(1)位置:/etc/httpd/conf/httpd.conf
(2)找到以 <Directory "/var/www/html">
開頭的部分
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
更改以上部分中的AllowOverride None行以讀取AllowOverride All
注意:此文件中有多條AllowOverride行。 確保更改該部分中的行。
AllowOverride All
(3)重啟Apache服務
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.