I have code that is working but am wondering if I am covering all my bases.
.htaccess at firstURL:
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)?var=(.*)$ [NC]
RewriteRule ^(.*)$ http://www.differentURL.com/varHandler.php [R=301,L]
RewriteRule ^(.*)$ http://www.differentURL.com/$1 [R=301,L]
In my mind the first Cond/Rule is handling the passing of the variables and the second Rule is handling visits to firstURL when no variables are present.
I think I handle variable checking pretty good at differentURL so I am thinking I don't have to check for any nefarious tampering at the firstURL.
I guess my two headed question: is this the most efficient way to accomplish what I want, and am I missing any details to handle any weird scenarios?