How to build a modx site Behind a static html version?

How to build a MODx site Behind a static HTML version so that after I finish the MODx CMS (and all its lovely features) I can take the static HTML page offline and reveal the MODx pages.

I know about the [Under Construction / Maintenance page, but its not working for me.

I always struggle to set this up and have a nice workflow without clients and customers being bothered with an in-development website.

Do you have the super tip?! :four_leaf_clover:

Without know how large or complex the site is, could create a empty template and copy the static html into the content area? Then you could replace the pages as you go.

1 Like

Thanks for the tip! That could work with a single page I guess. Not with a multiple page website I think.

You could develop the new site locally or under a subdomain. Then when everything is ready, upload the new files or just set the root of the site to the folder of the subdomain.


I usually do what @vibedesign suggested - but if you wanted to keep it very simple - you could try temporarily changing your default document via the .htaccess file in your site root:

#Alternate default index page
DirectoryIndex index.html

Upload your index.html file and any others relevant to your temporary site to the root directory.

This should point to the index.html file [instead of MODX’s index.php file].

When your MODX site is ready to go - just comment out or delete the above .htaccess lines.

1 Like

@vibedesign Thanks, Do you have a good (step-by-step) manual to guide me trough the process? It’s quite tricky to get it just right to make sense out of all of this.

@dejaya thank you, this sounds like the thing I would use. It’s the least complex option in my opinion. It’s just one setting :+1: I’ll have a go with that one.

Q. Does it mean that during the MODx installation the current site will be unreliable until I change the .htaccess file?

I suppose it would mean that links in your MODX site that pointed at the root of the site [ etc] would flip over to the live, temporary site home page instead of your MODX home page.

If your temporary site is straightforward HTML - I think it should work as expected

Hi @uxpascal,

So the easiest solution would still be the maintenance-mode - so what do you mean exactly with “it’s not working for me”?

The second best option, that I also use a lot, is the switching of document-roots in your hosting-interface (maybe cPanel?) - like @vibedesign suggested.

Regarding the “maintenance-mode”, check out this post.

Best of luck!

1 Like

If you want to follow VibeDesigns suggestion (which I recommend) there are some examples on these two pages, and a step-by-step process on the second one:

Why I put all MODX Sites in Subdirectories

Replacing an Existing Site

There’s also a discussion of using MODX Cloud for what you’re trying to do, which makes the process dead easy and almost seamless.

1 Like

Hi @sebastian-marinescu Thanks for the reply.

I have set the site-unavailable-page on another MODx site and put the site-status to NO. In the template, I have added all the HTML and CSS into the MODx site-unavailable-page-template.

This works well for a one-pager website (not sure if the CSS will work unless it is included in the template code.) but in my quick sketch, I hope to take you along into my question about a multiple-page website with all its assets etc. Can I just upload them using (S)FTP and will it all work?

@bobray I have had a quick read of the article, but it looks like it is just above my knowledge base. Too many assumptions of things, the reader knows in order to make it all work. I hope I’ll get some more low-level input to a nice workflow I feel comfortable with.

I think you’re overthinking it.

If your site is in “maintenance-mode”, only you as an admin, if logged into the manager/backend, will be able to see every page. Anonymous users will, even with knowledge of a potential subpage, always see your maintenance page.

Just do it :wink:

It sounds like @uxpascal has more of a multi-page site to display in the meantime - rather than just a single page - so not sure if the Site Status / Site Unavailable Page settings are going to cover that?

What’s your hosting situation @uxpascal ? Is it cPanel?

@dejaya and all other great minds.

Actually, I work on different hosting etc platforms. Not my choice, it’s done by the client.

In the meantime i have tested something and it seems to work. Let me take you along this configuration step-by-step. Remember, im not a technical person.

  1. Install MODx.

  2. create (copy) the code for the “maintenance- page” (aka the homepage) and place it in a template.

  3. Create the static html files or upload them via sFTP.
    Screenshot 2023-09-21 at 15.11.18

  4. in the system Settings set the Site-status to NO. (if needed set the Site-unavailable-page to the template you have made. (in this example nr2, as shown in step 2.)

I have tested it with the CSS code in the HTML pages. But I’m assuming this will work when you use external CSS also.

1 Like

Glad you’ve found a solution! :+1:

A drawback of this solution is, that you can’t now use the same URLs for the new MODX website as you used for the old static HTML site.

A request to will always show the static HTML file. If you create a resource in MODX with the same URL, you can’t test if the page looks correct (without calling the page with the id-parameter or like this →

It sounds like I need to do some more testing…

@halftrainedharry I did a quick test.
Questions of an overthinker… :thinking:

I have put the site in maintenance mode and in an incognito browser window it took me to the “offline page”. This works as I imagined it would. :white_check_mark:

:speech_balloon: You suggest that this will not let me see the “behind the scenes” development pages. Via the dashboard, I go to a resource page. Let’s say, “homepage”. I can then hit the view button and I see the webpage that would be displayed when the site status is “online”.

Do I overlook something? Because I can still use the online navigation and open other pages while the site is offline.

The VIEW button lets me see the page.

1 Like

I was only talking about pages in MODX that have the same URL as an existing static HTML file in the file system.

In your screenshot you have a file in the file system with the name “page-two.html”.
If you now create a MODX page with the alias “page-two” (and Content Type = HTML), you won’t be able to preview that.

If all the pages of your new MODX site have different URLs than the static files of the old site, then there is no problem.

1 Like