Website not behaving correct in Chrome, it does in Firefox

Hi,

A website I have is not working correct in Chrome but it does in FireFox.
Items that do not need to be displayed are in Chrome. And the linking (from getResources) is not linking to the correct page but to the home again.

https://fcmediadesign.nl/

It still use MODX Revolution 2.8.3-pl
I need to update. :upside_down_face:

Most likely your markup is just wrong and the two browsers have different ways to deal with errors.

Also, when I visit your site and open the developer tools in the browser, there are a lot of errors in the console. Maybe try fixing these first.

Ill check it all, it looks like it is all messed up in FireFox also now.

A good way to discover errors in your code is to test the page with the W3C markup and css validators. What you’re describing sounds like malformed html to me. (It’s a good idea to run your site pages through the validators before launch even if you don’t see anything that looks wrong.)

https://jigsaw.w3.org/css-validator/

Also, if you have links that take you to your home page instead of the expected page, that is likely the home page acting as your 404 Page Not Found page, which is the default behavior until you create your own 404 page and then use the settings to point 404s to that page ID.

1 Like

Thank you for the response.
I will work on the code and errors. It’s a hasty project :upside_down_face:

I have asked the hosting provider to update the PHP and the MODx version. It’s the same code that I use on a 3.0.1-pl version. I’ll update this question later. Hope it will be the answer… :smile:

I have updated the MODx version to 3.0.2-pl. As all the add-ons. Still, I get only the homepage on all URLs.

Examples of urls are:
https:// fcmediadesign.nl/artikelen/gamen-met-makey-makey/
https:// fcmediadesign.nl/artikelen/3d-artist/

they all show https:// fcmediadesign.nl

I have no idea what is making the site behave like this.

This looks like a problem with your Friendly URLs.

Pages are available in this format:

https://fcmediadesign.nl/index.php?id=3
https://fcmediadesign.nl/index.php?id=4
https://fcmediadesign.nl/index.php?id=5

Check that Friendly URLs are enabled in System Settings.

If they are - check that the .htaccess file is present in the root of your site.

And then check that the Friendly URL section in .htaccess is present and not commented out.

:white_check_mark: Friendly URLs are enabled in System Settings.

:white_check_mark: .htaccess file is present in the root of your site.

:white_check_mark: Friendly URL section in .htaccess is present (not commented out)

It turnes out that the server is running a version of NGINX not Apache

1 Like

nginx doesn’t typically read your .htaccess files (there are exceptions) so you’ll need to follow the nginx instructions.

1 Like

I found the same link. Thanks.
We are now working on it. Do we need to set the FURLs in MODx on or off?

I’ll update the results… :pray:

I think you’ll still want it turned on in System Settings :+1:

1 Like

We did follow the nginx instructions. that @markh mentioned, as some other stuff we did that ill try to put in this answer later. I need to contact the server manager about this.

I also needed to turn on the FURL option in MODx System Settings as @dejaya mentioned.

Thank you all for the help! :hugs: :white_check_mark:

1 Like

Glad you’ve got it sorted!

:+1:

Solution to the FURL not working and redirecting to the homepage on all links.

I would come back to how we got the friendly URLs working. Here’s a brief explanation.

The Nginx configuration file for WEBSITE-COM (/etc/nginx/sites-available/WEBSITE-COM) references the ‘php74.conf’ file:

include common/php74.conf;

In this configuration file (/etc/nginx/common/php74.conf) lines have been added to ensure that the URLs load correctly:

location @modx {
         rewrite ^/(.*)$ /index.php?q=$1&$args;
     }

     location ~ \.php(.*)$ {
         include fastcgi_params;
         fastcgi_pass unix:/var/run/php/php74-fpm.sock;
         fastcgi_index index.php;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     }

The reason these lines are added to this file, and not to its own configuration file, is that the ‘location’ would then be defined twice in this file, causing errors.

:warning:
NOTE! The disadvantage of modifying ‘php74.conf’ is that these lines disappear after updating WordOps (an alternative to Installatron, which runs on a server). So updates must be carried out ‘with care’, which we will be keen on.

Hopefully, this explanation is clear enough.
And again, thank you for all your help! Its highly appreciated.