WordPress permalink not working on aws

I have spent 4-5 hours to sort it out but not able to solve it.

I have setup my wordpress website on AWS.Everything is working file except the permalinks of wordpress.

Read More

When permalinks are set to default pages/posts are working but not working with “%post-name%”.

I have tried almost all the things by searching over google but no success.

I saw so many solutions all related to httpd.conf file but on my root there is no file httpd.conf neither no directory of http.

I changed the following code in apache.conf file but still not working

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Require all denied
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Restarted apache again and again but no luck.

Please help me guys.

Thanks.

Related posts

Leave a Reply

2 comments

  1. I’ve just managed to fix this error. Make sure you restart Apache service after making the httpd.conf change!


    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

    The bit you need to fix for permalinks is tp update the httpd.conf file

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

    (2) Find the section that starts with <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

    Note
    There are multiple AllowOverride lines in this file; be sure you change the line in the section.

    AllowOverride All
    

    (3) Restart the Apache service

  2. If you dont have much experience using aws, then i guess its because you have not granted enough permissions to your apache. If you are unware of how to grant permissions to your apache, you can use this command in your console

    sudo CHOWN -R apache:apache /var/www/html
    

    Once done try going to your settings page and saving the new settings.