Render pages without an extension in MODX

Render pages without an extension in MODX

This little trick can be used to make it harder for the script kiddies to identify what CMS your site is running on, MODX ships with 7 Content Types out of the box if you want you can add more, here's how to do it.

Create Custom Content Type

Click on System > Content Types once in the Content Type page Click on New Content Type, then insert the name you want to call your Content Type in this example we are using Anonymous in the Mime Type put text/html, leave the File Extension field empty, Binary leave it No and insert a description if you wish.

Select Custom Content Type

Now when creating a new resource or editing and existing one Click on the resources Settings Tab and in the Content Type drop down select Anonymous now our page will render without the HTML extension.

You can also add any other extension to MODX like ASP, ASPX, PHP, Less, doc etc. as long as you know the Mime Type you can add it to MODX.

06 Jun

Author Benjamin Marte Category Tricks Comments (1)

Comments (1)

  1. Mike Smull:
    Aug 07, 2012 at 09:11 PM

    This is an interesting trick. I've been just removing the extension from the HTML content type. Is it better to keep the HTML content type in tact and then create a separate content type like you explain above? I'm just curious if it makes a difference. I guess having the .html to go to when you want it might be a good thing.

Leave a Comment

This thread has been closed from taking new comments.

Scroll to top