We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53734
    • 5 Posts
    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.

    This question has been answered by mcarcher. See the first response.

    [ed. note: mcarcher last edited this post 9 years ago.]
    • discuss.answer
      • 53734
      • 5 Posts
      The answer is found.
        • 17301
        • 932 Posts
        Setting the resource as a container makes it a folder (container) for other resources. If you want to remove the .html suffix then you need to edit the content types and just remove .html
          ■ email: [email protected] | ■ website: https://alienbuild.uk

          The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.