For an .htaccess 301 redirect from a non-WWW to a WWW, which is "more correct?" Both seem to work just fine and do what I want, but I know each code-symbol does something important, so in the long run, which is better, please? This one? RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com RewriteRule (.*) http://www.example.com/$1 [R=301,L] ...or this one? RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com rewriterule ^(.*)$ http://www.example.com/$1 [R=301,L] Thank you.
jream, what's the pratical difference between (.*) and ^(.*) or how can this be abused? AFAIK any character (.) repeated zero or more times (*) will always matches a string from the beginning (^) so both should be the same as well as ^(.*)$ or (.*)$
@Jream, thank you for your reply.... BUT your reply says ^(.*) Did you leave off the $ on purpose? I want to make sure I do it correctly. Which is better: ^(.*) or this: ^(.*)$ I'm also curious about mpix's (the previous poster) question. Anyway, looks like there are 3 choices: a.) (.*) b.) ^(.*) c.) ^(.*)?
Well, I'm still not sure what's best. I realize my question was probably answered somewhere in this thread, but there is still some ambiguity appearing to me. I'd appreciate anyone's comments on this.