Unable to change Friendly URL setting in System Settings

When I try to enable the Friendly URL setting, it gets stuck like this, with the red flag in the corner:


Almost all of the other settings, besides a couple that are related to Friendly URLs, seem to work fine. The red flag displays for a moment, and then disappears, indicating that the setting was changed successfully.
I’ve set up my .htaccess file and placed it in the correct directory. I’m using Apache as well.
The result is that I can type any directory in and it will always display the home page resource. I’m confident that the .htaccess file is correct because if I remove it, typing in random directories will 404 instead.

Do you get any error messages when you try Manage–>Clear Cache ?

Thanks, I missed that step in the guide. However, yeah, there seems to be an issue when clearing cache. It doesn’t throw an error, but it’s just stuck on “Console running…” indefinitely.

Maybe try clearing the cache manually by deleting all the files in /core/cache.

1 Like

Thanks, just tried clearing the cache manually but both issues still persist.

Is there a way to manually change the system settings?

You could change the value directly in the database (e.g. with phpMyAdmin). The table has the name modx_system_settings. Search for the `key` = 'friendly_urls' and set the value to 1. Then clear the cache again.

Thanks, that worked to change the settings. The problems are still the same, though; Friendly URLs still aren’t working. Should I open a new topic, since the original question has been answered?

When you click the button “View” on a resource in the manager, does it open the new tab with the url https://www.yourdomain.com/yourpage.html or still with https://www.yourdomain.com/index.php?id=2?

Does it show the correct page if you enter this url into your browser? https://www.yourdomain.com/index.php?q=yourpage.html (replace yourpage with the alias of an existing page).

Maybe there is something wrong with your .htaccess file nevertheless. Keep it simple until it works and add additional content later.

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Is there something special about your MODx installation? Multiple contexts? Is the installation in a subfolder and not in the webroot?

Might be worth checking to see if compress_js / compress_css are both set to NO - can change in database if it doesn’t save in the manager.

Also, try a different browser or totally clear all browsing data?

Have the mod_security rules on your server been changed or updated recently? I have been experiencing a number of problems that all started at the same time, including this issue, and am so far finding the issues have been caused by new mod_security rules. I haven’t got as far as looking into this particular issue, but wouldn’t be surprised if it was this too, maybe worth checking or contacting your server provider support people if you don’t have this level of access on the server.

Further to my previous post, this “solved” thread about this issue would seem to confirm what I said.

Oh! I didn’t notice the “View” button until now, thank you. It turns out, the Friendly URLs actually do work, but not as I expected, they always have the suffix .html.
The thing that threw me off was that I couldn’t just do https://mysite.com/test/. It only works if I do https://mysite.com/test.html, as I learned after hitting the View button. All the things I found online, though, point to https://mysite.com/test/ being the right format, so I didn’t think to try anything else.
The container_suffix setting documentation says this:

A container suffix of / will render a Resource with an alias of ‘test’ as:

www.mysite.com/test/
whereas a container suffix of ‘.html’ will render:
www.mysite.com/test.html
container_suffix is set to / for me, so how come there’s still a .html suffix?

Sorry, it seems that all of this might have just been my lack of knowledge! But I’m still confused as to why it behaves like this.

In your resource “test” when you change to the “Settings” tab in the manager, is the checkbox “Container” checked? (This should happen automatically if the resource has children). Otherwise this resource is not considered a container-resource (and the container_suffix setting has no effect).

You can also change the file extension for ‘normal’ resources in the topmenu “Content” → “Content Types”.

Thank you very much. That worked great

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.