Sandeep Singh
Sandeep Singh

Reputation: 161

AWS Elastic BeanStalk + Wordpress URL rewrite Issue

Hey Guys i deployed wordpress with Elastic Bean Stalk ( i have nginx + RDS ) but only wordpress home page working fine but URL rewrite not working. ( wordpress home page working fine & wordpress from NON google friedly URL works fine ) problem is with URL rewrite anyone has any idea how we can solve this OR how we can install APACHE on AWS EBS ( i am using EBS + RDS + Code Pipeline )

Upvotes: 1

Views: 1244

Answers (2)

Alexander
Alexander

Reputation: 115

There isn't much detail to go on here but it sounds like you may need to update your NGINX configuration in order to point non-static files to index.php so that WordPress 'process' them accordingly.

If you add this to your nginx.conf file (in /etc/nginx/) inside the server{} block:

    location / {
      try_files $uri $uri/ /index.php?$query_string;
    }

Then reboot NGINX and test WordPress URLs to see if it worked:

sudo service nginx restart

If that does the job then you will need to make this change permanent, otherwise as your Elasticbeanstalk environment scales or is re-deployed the change will revert. To do this depends if you are using Amazon Linux 2 or the Amazon Linux AMI.

If you are using AL2 then you need to add this change to the .platform/nginx/conf.d/elasticbeanstalk/ directory of your local development environment and re-deploy, see here: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html

If using the Amazon Linux AMI you will need to create a .conf file in the .ebextensions folder which implements the change upon deployment, see here: https://aws.amazon.com/premiumsupport/knowledge-center/elastic-beanstalk-configuration-files/

Upvotes: 2

Marcin
Marcin

Reputation: 238051

The AWS provides official whitepapers and guides on how to properly setup and run Wordpress on Beanstalk. I put the links to them, since from your question it is not clear if you followed any of them and why they don't work, nor why they are not suited for your use case:

If your needs are different, updating the question with more details and explanations would be useful to provide more detailed answer.

Upvotes: 0

Related Questions