Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Redirect an url to other root on a multiple domain server

$
0
0
Hello,

I have a server with multiple domains (tendanza.com, canapes-design.com, canapes-pas-cher.com, etc), all the domains being used on the same website (different views).
I need to have www.canapes-design.com/blog/ to be a wordpress (I created a folder /var/www/blog/cd/) but I don't want the other domains to point on it.

I did this:

location /blog/ {
if ($host ~ canapes-design\.com) {
alias /var/www/blog/cd;
}
}

location /blog {
if ($host ~ canapes-design\.com) {
rewrite /blog(.*)$ /blog/$1 permanent;
}
}


and created an index.html in /var/www/blog/cd/blog, it works well.
But I also created a test.php but then I am redirected to a 404 on the main website.

I tried to do "root /var/www/blog/cd;" instead of "alias /var/www/blog/cd;", but it's the exactly same problem.

Would you know how I could fiw this, please?

Thank you,

François

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>