Home > AI > Backend > Drupal >

Troubleshoot: only front-page is working, other pages are 404 Not Found

Background:

Server: Nginx

File location: /Users/{my_username}/web-nginx/drupal

Reason:

Since I used composer to install the Drupal, the html location is at

/Users/{my_username}/web-nginx/drupal/web/

But nginx will direct other links other than homepage to /Users/{my_username}/web-nginx/

Solution:

change nginx.conf

find the nginx config file location

nginx -t

add try_files

location / {
            root   /Users/workmac/documents/web-nginx;
            index  index.html index.htm index.php;
            # Shark added on 2nd May 2022
            try_files $uri /drupal/web/index.php?$query_string;
        }
Related posts:

Leave a Reply