Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permalinks do not work #27

Open
GuerrillaCoder opened this issue Feb 3, 2021 · 1 comment
Open

Permalinks do not work #27

GuerrillaCoder opened this issue Feb 3, 2021 · 1 comment

Comments

@GuerrillaCoder
Copy link

Permalinks do not work with this config. How do I set the nginx re-write rules?

@bunnmv
Copy link

bunnmv commented Mar 15, 2021

I faced the same issue and eventually I was able to solve it following these 2 steps.

1 - New Location Rule:

New NGINX Location rule

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

2 - How to edit the NGINX location rules:

Configure NGINX with .ebextensions

Place that script in a new file located in .platform/nginx/conf.d/elasticbeanstalk, I named mine permalink.conf

.platform
    nginx
         conf.d
             elasticbeanstalk
                 permalink.conf

Optitional - Elementor Fix

After using the new location rule I was still facing issues with Elementor.

Elementor Fix

Replacing permalink.conf with the following code fixed it.

location /{
    try_files $uri $uri/ /index.php$is_args$args;
}

Final permalink.conf code :

#pemalink fix

# Enable WordPress Permalinks Support (default .htaccess replacement)
# .platform/nginx/conf.d/elasticbeanstalk/permalink.conf
location / {
    try_files $uri $uri/ /index.php$is_args$args;
}

Hope these work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants