
Question:
I am using modx, which is a cms system. It has a friendly url-option and uses a .htaccess like this.
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
If makes the url look like: mysite.com/about and mysite.com/about/contact
I'd like to expand this .htaccess, so I can write myste.com/about/2 without the page 2 actually existing. I'd like to have the ability to access this in a get-variable. Can this be done? I have no knowledge at this area whatsoever.
Answer1:You <em>could</em> do this in your .htaccess, but a better way might be to create a plugin that fires on the OnPageNotFound event.
myste.com/about/2 does not exist so it will trigger your plugin which will run before sending the user to the 404 page. In this case, you can can split the /2 from the end of the url and use it to pull in your data or send the user to a different page instead of going to 404.
Does that make sense? It's a bit difficult to contribute more without knowing exactly what you want to do :)