Hi,
I have a question about rewriting non WWW urls to WWW urls...
I have acomplished this with:
Code:
server {
listen 80;
server_name mydomain.com;
rewrite ^(.*) http://www.mydomain.com$1 permanent;
}
It works BUT what is the difference with this syntax:
Code:
server {
listen 80;
server_name mydomain.com;
rewrite ^/(.*) http://www.mydomain.com/$1 permanent;
}
On the second example there are two slash symbols / added inside the syntax and it seems the second syntax gives the same result.
But which one is correct to use???
The first syntax
without the slash symbols or the second syntax
with the slash symbols included? Is there any difference in usability or in the produced result? It looks they work the same but maybe there is something that i dont see.
Thanks for any help
George