简体   繁体   English

WordPress的永久链接无法在AWS上正常工作

[英]wordpress permalink not working on aws serever

I am working on wordpress project. 我正在从事wordpress项目。 but permalinks not working. 但永久链接无法正常工作。 If I set them to default it works but when I set it to post name it goes to 404 error. 如果我将它们设置为默认值,则可以使用,但是当我将其设置为发布名称时,它将出现404错误。

my htaccess file is: 我的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

' Help me out what is wrong with my wordpress. '帮我找出我的wordpress的问题所在。

Thanks 谢谢

I've just managed to fix this error. 我已经设法解决了这个错误。 Documentation here has a checklist of all the changes you need to get wordpress working correclty on AWS - including getting permissions correct: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html 此处的文档列出了使Wordpress在AWS上正常运行所需的所有更改的清单-包括正确获取权限: http ://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html

The bit you need to fix for permalinks is tp update the httpd.conf file 您需要修复的永久链接是tp 更新httpd.conf文件

(1) Location: /etc/httpd/conf/httpd.conf (1)位置:/etc/httpd/conf/httpd.conf

(2) Find the section that starts with <Directory "/var/www/html"> (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

Change the AllowOverride None line in the above section to read AllowOverride All 更改以上部分中的AllowOverride None行以读取AllowOverride All

Note There are multiple AllowOverride lines in this file; 注意:此文件中有多条AllowOverride行。 be sure you change the line in the section. 确保更改该部分中的行。

AllowOverride All

(3) Restart the Apache service (3)重启Apache服务

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM