ModX Revolution Friendly URLs

Home / Blog / ModX Revolution Friendly URLs

ModX Revolution Friendly URLs

Posted:  November 26, 2013

ModX Revolution Friendly URLs

I have become quite the ModX lover lately, I use it to run a great number of client websites and find that it is extremely speedy, easy to use (from my perspective), and easy to teach.

There are a few things I don’t like about it, but this post is not about that (well… at least not all of them :)).  This post is about SEO and URL Friendliness.

Now ModX has a great built-in way to allow us to have friendly URLs for our content resources, however, by default all HTML content pages are given the .html extension.  While this normally is not a big deal, I am a bit of a stickler when it comes to my URL’s.  I like them with no extension what-so-ever.

So… after much digging around in my site’s settings, I finally figured out how to take care of this.   Here are the steps I took, hopefully it will help you accomplish the same thing.

First and foremost, after you install ModX on your server, make sure to create or update your existing .htaccess file:

RewriteEngine On
RewriteBase /

ErrorDocument 404 /page-not-found

# for now, set the default document to index.htm
# DirectoryIndex index.htm index.php

# The Friendly URLs part - for normal pages
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]

# caching static files
<IfModule mod_headers.c>
 <FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|bmp|js|css|swf|woff|svg|ttf|otf|eot)(.gz)?$">
		# To Prevent Caching
		#Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
		#Header set Pragma "no-cache"
		#Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
		# Cache
		Header unset Pragma
		Header unset ETag
		Header set Cache-Control "max-age=31556000, store, cache"
		Header unset Last-Modified
		Header set Connection keep-alive
		Header add X-PoweredBy "o7th Web Design ~ Real Design, Real Development, by Real People ~ "
 </FilesMatch>
</IfModule>
FileETag None
<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresDefault "access plus 1 seconds"
	ExpiresByType text/html M31556000
	ExpiresByType image/gif M31556000
	ExpiresByType image/jpeg M31556000
	ExpiresByType image/png M31556000
	ExpiresByType text/css M31556000
	ExpiresByType text/javascript M31556000
	ExpiresByType application/javascript M31556000
	ExpiresByType application/x-javascript M31556000
	ExpiresByType text/xml M31556000
	ExpiresByType image/svg+xml M31556000
	ExpiresByType application/x-font-ttf M31556000
	ExpiresByType application/x-font-truetype M31556000
	ExpiresByType application/x-font-opentype M31556000
	ExpiresByType application/vnd.ms-fontobject M31556000
	ExpiresByType application/x-font-woff M31556000 
</IfModule>

# For servers that support output compression, you should pick up a bit of
# speed by un-commenting the following lines.

php_flag zlib.output_compression On
php_value zlib.output_compression_level 9

Now, as you can see it put in a few extras for you, these are to help speed up for site, ensure caching, etc…  the main lines to look for in here are the  re-write rules.  You will notice that we are taking every page request, and sending the to the ModX processor.

Now, the next step to take is to of course turn on the Friendly URLs in our ModX manager, so go ahead and login and get to your ‘System Settings‘ page.  Once there, select ‘Friendly URL‘ from the “Filter by area...” drop-down.

Look for “Use Friendly URL” and change the setting to “Yes“.  I would go a couple steps further here and make sure that the system checks for duplicates, and uses Alias Path.

Once you do that, head over to your ‘System‘ menu once again, and click on ‘Content Types‘.  Now, the default content type for all resource pages is HTML (text/html), so look for HTML, and under “File Extension“, delete out the .html and hit save.

Clear your ModX cache, Remove All Locks, and then browse your site, all your URL’s should now be extensionless 🙂

Hope this helps, and as always… happy coding!

Please note, this has only been tested in ModX Revolution, 2.+

~Kevin

Kevin Pirnie

20+ Years of PC and server maintenance & over 15+ years of web development/design experience; you can rest assured that I take every measure possible to ensure your computers are running to their peak potentials. I treat them as if they were mine, and I am quite a stickler about keeping my machines up to date and optimized to run as well as they can.

Cookie Notice

This site utilizes cookies to improve your browsing experience, analyze the type of traffic we receive, and serve up proper content for you. If you wish to continue browsing, you must agree to allow us to set these cookies. If not, please visit another website.

ModX Revolution Friendly URLs

I have become quite the ModX lover lately, I use it to run a great number of client websites and find that it is extremely speedy, easy to use (from my perspective), and easy to teach.

There are a few things I don’t like about it, but this post is not about that (well… at least not all of them :)).  This post is about SEO and URL Friendliness.

Now ModX has a great built-in way to allow us to have friendly URLs for our content resources, however, by default all HTML content pages are given the .html extension.  While this normally is not a big deal, I am a bit of a stickler when it comes to my URL’s.  I like them with no extension what-so-ever.

So… after much digging around in my site’s settings, I finally figured out how to take care of this.   Here are the steps I took, hopefully it will help you accomplish the same thing.

First and foremost, after you install ModX on your server, make sure to create or update your existing .htaccess file:

RewriteEngine On
RewriteBase /

ErrorDocument 404 /page-not-found

# for now, set the default document to index.htm
# DirectoryIndex index.htm index.php

# The Friendly URLs part - for normal pages
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]

# caching static files
<IfModule mod_headers.c>
 <FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|bmp|js|css|swf|woff|svg|ttf|otf|eot)(.gz)?$">
		# To Prevent Caching
		#Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
		#Header set Pragma "no-cache"
		#Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
		# Cache
		Header unset Pragma
		Header unset ETag
		Header set Cache-Control "max-age=31556000, store, cache"
		Header unset Last-Modified
		Header set Connection keep-alive
		Header add X-PoweredBy "o7th Web Design ~ Real Design, Real Development, by Real People ~ "
 </FilesMatch>
</IfModule>
FileETag None
<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresDefault "access plus 1 seconds"
	ExpiresByType text/html M31556000
	ExpiresByType image/gif M31556000
	ExpiresByType image/jpeg M31556000
	ExpiresByType image/png M31556000
	ExpiresByType text/css M31556000
	ExpiresByType text/javascript M31556000
	ExpiresByType application/javascript M31556000
	ExpiresByType application/x-javascript M31556000
	ExpiresByType text/xml M31556000
	ExpiresByType image/svg+xml M31556000
	ExpiresByType application/x-font-ttf M31556000
	ExpiresByType application/x-font-truetype M31556000
	ExpiresByType application/x-font-opentype M31556000
	ExpiresByType application/vnd.ms-fontobject M31556000
	ExpiresByType application/x-font-woff M31556000 
</IfModule>

# For servers that support output compression, you should pick up a bit of
# speed by un-commenting the following lines.

php_flag zlib.output_compression On
php_value zlib.output_compression_level 9

Now, as you can see it put in a few extras for you, these are to help speed up for site, ensure caching, etc…  the main lines to look for in here are the  re-write rules.  You will notice that we are taking every page request, and sending the to the ModX processor.

Now, the next step to take is to of course turn on the Friendly URLs in our ModX manager, so go ahead and login and get to your ‘System Settings‘ page.  Once there, select ‘Friendly URL‘ from the “Filter by area...” drop-down.

Look for “Use Friendly URL” and change the setting to “Yes“.  I would go a couple steps further here and make sure that the system checks for duplicates, and uses Alias Path.

Once you do that, head over to your ‘System‘ menu once again, and click on ‘Content Types‘.  Now, the default content type for all resource pages is HTML (text/html), so look for HTML, and under “File Extension“, delete out the .html and hit save.

Clear your ModX cache, Remove All Locks, and then browse your site, all your URL’s should now be extensionless 🙂

Hope this helps, and as always… happy coding!

Please note, this has only been tested in ModX Revolution, 2.+

~Kevin

Our Privacy Policy

Last Updated: June 18th, 2025

Introduction

Western Mass Hosting (“we,” “our,” or “us”) respects the privacy of all individuals and organizations that interact with our services. This Privacy Policy establishes our practices regarding the collection, use, disclosure, and protection of personal information for visitors to our website and clients utilizing our managed hosting and WordPress services. By accessing our website or engaging our services, you acknowledge that you have read and understood this policy in its entirety.

Scope and Applicability

This Privacy Policy governs our handling of information collected through our corporate website and in the course of providing managed hosting, WordPress maintenance, and development services. In accordance with global privacy regulations, we serve as a Data Controller for information related to our business operations and client relationships. When processing data on behalf of our clients through hosted services, we act as a Data Processor under applicable data protection laws.

Information We Collect

We collect various categories of information necessary to provide and improve our services. This includes personal contact and payment details provided during account registration, technical information such as IP addresses and device characteristics for security purposes, and records of communications through support channels. For clients utilizing our hosting services, we may process end-user data stored within client websites, though we do not control or monitor the collection practices of such data.

Purpose and Legal Basis for Processing

We process personal information only when we have proper justification under applicable laws. The primary legal bases for our processing activities include the necessity to fulfill contractual obligations to our clients, our legitimate business interests in maintaining and improving our services, and in limited cases, explicit consent for specific marketing communications. We maintain detailed records of processing activities to demonstrate compliance with legal requirements.

Use of Collected Information

The information we collect serves multiple business purposes. Primarily, we use this data to deliver and maintain reliable hosting services, including server provisioning, performance monitoring, and technical support. We also utilize information for business operations such as billing, customer relationship management, and service improvement initiatives. Security represents another critical use case, where we analyze data to detect and prevent fraudulent activity or unauthorized access to our systems.

Data Sharing and Third-Party Disclosures

We engage with carefully selected third-party service providers to support our operations, including cloud infrastructure providers, payment processors, and customer support platforms. These relationships are governed by strict contractual agreements that mandate appropriate data protection measures. We may disclose information when legally required to comply with court orders, government requests, or to protect our legal rights and the security of our services.

International Data Transfers

As a global service provider, we may transfer and process data in various locations worldwide. When transferring personal data originating from the European Economic Area or other regulated jurisdictions, we implement appropriate safeguards such as Standard Contractual Clauses and rely on adequacy decisions where applicable. Our subprocessors, including AWS Lightsail, maintain robust compliance certifications to ensure the protection of transferred data.

Data Retention Practices

We retain personal information only for as long as necessary to fulfill the purposes outlined in this policy. Client account information is typically maintained for five years following service termination to comply with legal and financial reporting obligations. Backup data associated with hosting services is automatically purged after thirty days, as specified in our Terms of Service. For data processed on behalf of clients, retention periods are determined by the respective client’s policies and instructions.

Security Measures

We implement comprehensive technical and organizational security measures to protect personal information against unauthorized access, alteration, or destruction. Our security program includes network encryption protocols, regular vulnerability assessments, strict access controls, and employee training on data protection best practices. We maintain incident response procedures to address potential security breaches and will notify affected parties where required by law.

Individual Rights

Individuals whose personal data we process may exercise certain rights under applicable privacy laws. These rights may include requesting access to their information, seeking correction of inaccurate data, requesting deletion under specific circumstances, and objecting to particular processing activities. We have established procedures to handle such requests in accordance with legal requirements, typically responding within thirty days of receipt. Requests should be submitted to our designated Data Protection Officer through the contact information provided in this policy.

Cookies and Tracking Technologies

Our website employs various technologies to enhance user experience and analyze site performance. Essential cookies are used for basic functionality and security purposes, while analytics cookies help us understand how visitors interact with our site. Marketing cookies are only deployed with explicit user consent. Visitors can manage cookie preferences through their browser settings or our cookie consent tool.

Policy Updates and Notifications

We periodically review and update this Privacy Policy to reflect changes in our practices or legal obligations. Material changes will be communicated to affected clients through email notifications at least thirty days prior to implementation. Continued use of our services following such notifications constitutes acceptance of the revised policy.

Contact Information

For questions or concerns regarding this Privacy Policy or our privacy practices, please contact our Data Protection Officer at info@westernmasshosting.com or by mail at:

Western Mass Hosting
22 Orlando. St.,
Feeding Hills, MA 01030.

We take all privacy-related inquiries seriously and will respond promptly to legitimate requests. For clients with specific data processing agreements, please reference your contract for any additional terms that may apply to our handling of your data.