Is there a way to forbid accessing documents using numeric IDs so that they are available thru aliases only? Thanks.
Using MODx 0.9.6.3
-
☆ A M B ☆
- 24,524 Posts
You could use a plugin. Use the OnWebPageInit event, and check the $modx->documentMethod value; it will be ’id’ or ’alias’. If it’s ’id’ then either redirect or send to the unauthorized or error page ( $modx->sendErrorPage(); )
I’m sure you could also deal with this in the .htaccess file, although that’s outside of my area of knowledge.
Thanks so much, your advice is exactly what I was looking for! I would prefer stick to the way .htaccess works by default and work this around via the code.