Forum Moderators: phranque
I've been trying for the past hour to figure this one out however I'm not that clued up when it comes to mod-rewrite! I currently have some working code/mod-rewrite which redirects a var starting with '-' to a new location:
RewriteRule ^-(.*)$ [mydomain.net...] [QSA]
This will redirect [mydomain.net...] to [mydomain.net...]
I want to be able to add an amendment which allows for an extra var in the format [mydomain.net...] to [mydomain.net...]
My current code is:
RewriteRule ^-(.*)/(.*).html$ [mydomain.net...] [QSA]
However since the 2nd var isn't always present, it's bombing out when ommited.
Any ideas which will allow it to work with, or without the 2nd var?
Thanks in advance.
RewriteRule ^-([^/]+)/([^.]+)\.html$ http://www.mydomain.net/view-report.html?s=$1&repdate=$2 [QSA,L]
RewriteRule ^-([^.]+)\.html$ http://www.mydomain.net/view-report.html?s=$1 [QSA,L]
Jim