I'm trying to change the output of page
s depending on the URIs last section. This will be used to enable the user to change the page's presentation by changing the URL (e.g. /path/to/page/xml
would show the page
's content as XML).
The mode-selector should be ignored when Wordpress queries the page, so all three URIs should result in the same page
content but add a query-parameter mode
without doing a redirect (the parameter should be internal only, not visible to the user).
Example:
Unchanged Page: /path/to/page
Mode 1: /path/to/page/mode1 => /path/to/page?mode=m1
Mode 2: /path/to/page/mode2 => /path/to/page?mode=m2
When I add a rule to .htaccess
, the parameter is added, but the page is not found (404). Wordpress seems to use the original URI, instead of the rewritten one.
I tried varients of the following rule, without success:
RewriteRule (.+)/mode1$ $1?mode=m1 [QSA]
What am I missing?
.../page/booking
for a booking-process or.../page/xml
for an XML represendation of the page.