Hi,<br><br>I have a nginx config with 4 virtual hosts.<br><br>Specifically I have the following server_name declarations in my virtual hosts:<br><br>#VH1<br>server_name <a href="http://es.mydomain.com">es.mydomain.com</a>;
<br><br>#VH2<br><a href="http://en.mydomain.com">en.mydomain.com</a>;<br><br>#VH3<br><a href="http://fr.mydomain.com">fr.mydomain.com</a>;<br><br>#VH4<br><a href="http://mydomain.com">mydomain.com</a> *.mydomain.com;<br><br>
What I&#39;d like to do is rewrite any request for VH4 (i.e. not es/en/fr.mydomain.com) to :<br><br><a href="http://www.mydomain.com">www.mydomain.com</a><br><br>So if a request comes in for <a href="http://wwww.mydomain.com">
wwww.mydomain.com</a> I&#39;d like to rewrite it to <a href="http://www.mydomain.com/$request_filename">www.mydomain.com/$request_filename</a><br><br>I&#39;ve tried a few things but haven&#39;t managed to get it right.<br>
<br>My latest try:<br><br>#In VH4 server declaration<br>location / <br>{<br>&nbsp; if ($host !~ &quot;/^(www\.)?amicsmuseuprecolombi\.org/&quot;) {<br>
&nbsp;&nbsp;&nbsp; rewrite&nbsp; (.*)&nbsp; <a href="http://www.amicsmuseuprecolombi.org$1">http://www.amicsmuseuprecolombi.org$1</a>&nbsp; permanent;<br>&nbsp; }<br>}<br><br><br><br>Thanks,<br><br>Saimon<br>