I'm a newbie. I create the site while locally. But something with addresses: only the main page opens (it is 404 for now) - that from the browser, which follows the link on the page.

I use MODX. Friendly URLs included, nested - while turned off. In index.html I use the tag:

<base href="[[!++site_url]]" /> 

In .htaccess, I have not touched anything yet. Tell me what to do?

  • .htaccess renamed correctly? How exactly is the site deployed? ! in [[!++site_url]] superfluous is a system setting. - Vasis
  • 1) Just in FreeCommander took and renamed. - Alexander Shmuratko
  • 2) Put MODX in OpenServer / domains / mysite /, created a database, user, etc. according to the online lesson. In / assets / templates / threw a couple of pages and css. I set up something in the admin panel (including friendly URLs) - also according to the online lesson. - Alexander Shmuratko

2 answers 2

If all pages except the main one give out 404 - it's in htaccess - look for what's the matter with it. Maybe the name is wrong, maybe the Apache is configured incorrectly. Or turn off the friendly URLs altogether - for the local test it will be enough and everything will work to bypass htaccess.

  • Turned off the friendly URL - page opens. But it’s so inconvenient for me to work ... How do I set up links on the site? - Alexander Shmuratko
  • Nothing to do - either to understand what is the matter - or so. Links are listed like this: [[~нужный_айди_ресурса]] - Vasis
  • Okay, thanks for the help. - Alexander Shmuratko

Uncomment the following lines in the .htaccess file (uncheck #):

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

Then uncomment for the website without www:

 RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC] RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L] 

If the site is www, then these are:

 RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC] RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L] 

Do not forget to replace the address here with your own, and do not use both of these options at the same time! Should work