I have a single page in Wordpress that has lookups to a sql server and presents different content based on the querystring.
For instance, the URL I use is https://some-server.com/dynamic-page/?stem=name-of-content-to-be-looked-up
When I access the page and change the querystring, the content changes. Perfect.
Now, I do not want the querystring to be exposed to the end user, so I am attempting to use mod_rewrite such as this:
RewriteRule ^ds/(.*) /dynamic-page/?stem=$1 [PT]
The idea being that the URL to the end user would look like https://some-server.com/ds/name-of-content-to-be-looked-up
When I use a 301 redirect, it works great. When I use the internal redirect, it 404's. I have tried several different flags on the end, but all fail with a 404.
Has anyone ever tried this and done it successfully? Care to share some ideas?
I have tried the following, plus more, none work:
RewriteRule ^ds/(.*) /dynamic-page/?stem=$1 [PT]
RewriteRule ^ds/(.*) /dynamic-page/?stem=$1 [L]
RewriteRule ^ds/(.*) /dynamic-page/?stem=$1 [R,L]
RewriteRule ^ds/(.*) /dynamic-page?stem=$1 [QSA,NS,L]
RewriteCond %{REQUEST_URI} ^/ds/
RewriteRule ^ds/(.*) /index.php/dynamic-page?stem=$1 [PT]
Any ideas?
Thanks, Brian