MODX Version = 2.5.7.
Fresh test installation.
Apache Version = 2.4.25.
PHP Version = 7.0.22.
I created a template and a test page. Enabled friednly URLs as in user's guide.
A test page has an ID='2' and alias='testpage'.
When I open the test page by ID, it opens fine.
http://localhost/index.php?id=2
Status 200.
When I open it by alias, it says error 404.
http://localhost/index.php?q=testpage
Status 404.
Apache works fine, it redirects to the 'q=xxx' page. I have checked id by adding the directive's flag "R". So, the reason is in MODX. FURL (friendly_urls) setting is set to 'Yes'.
Configuration of Apache's virtual host:
<Directory "...my_directory_here...">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
# MODX Friendly URLs
RewriteEngine On
RewriteBase /
RewriteCond "%{REQUEST_FILENAME}" "!-f"
RewriteCond "%{REQUEST_FILENAME}" "!-d"
RewriteRule "^(.*)$" "index.php?q=$1" [L,QSA,R]
#RewriteRule "^(.*)$" "index.php?q=$1" [L,QSA]
#
</Directory>
Template has <base> tag:
<!doctype html>
<html lang="en">
<head>
<meta charset="[[++modx_charset]]" />
<title>[[*pagetitle]] :: [[++site_name]]</title>
<base href="[[!++site_url]]" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="*" />
<meta name="keywords" content="*" />
<meta name="author" content="*" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="css/a.css" />
<script charset="utf-8" type="application/javascript" defer="defer" src="js/a.js"></script>
</head>
...
Resource Type: Document;
Content Type: HTML;
Content Disposition: Inline;
Menu Index: 1;
Enabled: Searchable, Rich Text, Cacheable, Empty Cache, Published.
Tried to open a default index page that comes with MODX and has alias='index':
http://localhost/index.php?q=index
Status 404
After all 404-th status replies, the server redirects to default page.
Screenshot in Firefox:
https://s26.postimg.org/wbb1p33dl/Screenshot_2017-09-03_16-53-38.png
What else to check?
btw, each page on this forum loads more than a minute, just like on my 56K ZyXEL in 1990's ))) do something with that.
P. S.
http://localhost:81/testpage.html
works
seems that it requires an '.html' suffix after the alias.
if i enable 'Container' setting of a Resource, it stops requiring '.html' suffix.
[ed. note: mcarcher last edited this post 9 years ago.]