2010-08-19 90 views

回答

2

其實我想冒險一個猜測,你會有相同的麻煩,重定向該網址作爲實際服務。

首先,這裏有一個基本的重定向的語法:

server { 
    # ... 

    # redirect sitemap.xml to sitemap.xml.php 
    rewrite ^(/sitemap.xml)$ /sitemap.xml.php; 

    # ... 
} 

你越來越兩者wwwnot-www正確提供什麼可能的工作。常見的策略是服務所有wwwnon-www,反之亦然。這裏有一個例子:

server { 
    listen 80; 
    server_name www.mydomain.com; 

    # forward everything from www.domain.com to domain.com 
    rewrite ^(.*) http://domain.com$1 permanent; 
} 

server { 

    listen 80; 
    server_name domain.com *.domain.com; 

    location/{ 
      root /var/www/domain/htdocs; 
      index index.html index.htm index.php; 

      # ... etc. 
    } 
} 
+0

謝謝! 由於此鏈接,我已解決此問題: http://wordpress.org/support/topic/problem-with-sitemap-1 – Ikbear 2010-08-19 08:20:02