• Resolved fpiraneo

    (@fpiraneo)


    Hi everybody,
    I’m new in WP but I’ve understand that many people has issues with “pretty” permalinks.
    I’m one of the many! 😀
    Hopefully I had googled around and checked may things but the solution doesn’t came, so here to ask for help.

    When I ran a “Site Health” I receive a warning about REST API doesn’t working – Unexpected result 404.

    What I checked:
    – Running on debian 10 LAMP – apache2 rewrite module: Enabled;
    – WP dir writeable to “www-data” -> .htaccess is modified every time I change under “Settings-Permalinks”; plugins can install by themself without FTP access;
    – Everything works fine with “ugly” permalinks; when I enable “pretty” permalinks the issue appears;
    – Everything is last version – No updates underlined;
    – WP running a fresh install (v. 5.3.2);
    – No funny themes installed: just the defaults;
    – Plugins: bbPress, NinjaMotd, PolyLang, WP Cerber Security Antispam & Malware Scan, WP Statistics.

    In this situation the Gutemberg block editor run only with “ugly” permalinks.

    Follows my apache2 configuration file.

    Please note: I’m behind a NGINX reverse proxy (just one public IP, sorry!); follows also config file.

    Any suggestion to check is strongly welcome!

    Thank you very much!

    Francesco

    <strong># apache2ctl -M</strong>
    Loaded Modules:
     core_module (static)
     so_module (static)
     watchdog_module (static)
     http_module (static)
     log_config_module (static)
     logio_module (static)
     version_module (static)
     unixd_module (static)
     access_compat_module (shared)
     alias_module (shared)
     auth_basic_module (shared)
     authn_core_module (shared)
     authn_file_module (shared)
     authz_core_module (shared)
     authz_host_module (shared)
     authz_user_module (shared)
     autoindex_module (shared)
     deflate_module (shared)
     dir_module (shared)
     env_module (shared)
     filter_module (shared)
     mime_module (shared)
     mpm_prefork_module (shared)
     negotiation_module (shared)
     php7_module (shared)
     reqtimeout_module (shared)
     rewrite_module (shared)
     setenvif_module (shared)
     status_module (shared)

    Apache2 site configuration file:
    On a linux container: This is the only website on this container

    <VirtualHost *:80>
            ServerAdmin [email protected]
            DocumentRoot /var/www/www.mysite.ch/
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

    NGINX proxy configuration file:

    server {
      listen 443 ssl;
      server_name www.mysite.ch;
      ssl_certificate /etc/letsencrypt/live/mysite.ch/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/mysite.ch/privkey.pem;
    
      location / {
           gzip                    off;
    
           proxy_read_timeout      300;
           proxy_connect_timeout   300;
           proxy_redirect          off;
    
           proxy_set_header        Host                $http_host;
           proxy_set_header        X-Real-IP           $remote_addr;
           proxy_set_header        X-Forwarded-For     $proxy_add_x_forwarded_for;
           proxy_set_header        X-Forwarded-Proto   https;
           proxy_set_header        X-Frame-Options     SAMEORIGIN;
    
           proxy_pass http://192.168.1.159/; # This is the IP addr of the LXC where WP run
      }
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter fpiraneo

    (@fpiraneo)

    More setup:
    Generated .htaccess with “pretty” permalinks enabled
    This is the format I choose: https://www.mysite.ch/sample-post/

    # BEGIN WordPress
    # The directives (lines) between <code>BEGIN WordPress</code> and <code>END WordPress</code> are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <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
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    In your virtual host config files for both ports 443 and 80, add this:

    <Directory /var/www/www.mysite.ch>
      AllowOverride All
    </Directory>
    

    then restart Apache.

    The default is “None”, which causes the web server to ignore .htacess.

    Thread Starter fpiraneo

    (@fpiraneo)

    @sterndata Solved!!!

    Thank you very much!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Yet another permalink issue :-)’ is closed to new replies.