I have a problem.
My app server is nginx, on which my blog was hosted.
when i visited my sitemap with this url:
http://www.ikbear.com/sitemap.xml, it works.But when i visited my sitemap with this url:
http://ikbear.com/sitemap.xml, it doesn’t work. So i want to redirect http://ikbear.com/sitemap.xml to http://www.ikbear.com/sitemap.xml, would you tell me how can i do that in nginx? Thanks!
I have a problem. My app server is nginx, on which my blog was
Share
Actually I’m going to venture a guess that you’ll have the same trouble redirecting that url as actually serving it.
First, here’s the syntax for a basic redirect:
What might work for you is getting both
wwwandnot-wwwserving correctly. A common strategy is to serve allwwwtonon-www, or vice versa. Here’s an example of that: