The MacNN community has been great in the past for helping me get past problems, so I hope it can do so again.
I am trying to set up a dynamic website to show clean urls using RewriteRule in Apache. I want the url to look like this:
www.site.com/variable1/variable2/variable3
and the page to be served from
www.site.com/variable1?id=variable2&sid=variable3
The problem is that, some of the pages only have variable1 and variable2, but some have three. And I may add a third to the ones that only have two later. Here is what I have in my .htaccess file:
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{REQUEST_URI} !^/pdf
RewriteRule ^(.*)/(.*)/?(.*) $1?id=$2&sid=$3
The problem is that I cannot get the third variable to pass through. I have also tried
RewriteRule ^(.*)/(.*)/?(.*)$ $1?id=$2&sid=$3
Is there an easy way to write this?