2016-10-07 8 views
1

でアクセスできないファイルをsitemapindex.xml:example.com/forumsバニラフォーラムは、私のフォーラムは、URLにインストールされているnginxの

私が使用しているnginxのとバニラのURLを「飾り立てる」します。私は私のnginx.confに

/forum/conf/config.php, “RewriteUrls” to “True”.

を設定しました:

location /forums { 
    index index.php index.htm index.html; 
    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { 
     access_log off; 
     log_not_found off; 
     expires 30d; 
    } 

    try_files $uri $uri/ @forums; 
} 

location @forums { 
    rewrite ^/forums(.+)$ /forums/index.php?p=$1 last; 
} 

問題は、私はバニラフォーラムでsitemap pluginを設置しています。

、そして得られたサイトマップを

example.com/forums/sitemapindex.xml

に位置することになってしかし、私はそこにnginxのは私に404

どのように私はこれを解決するのですを与える移動するときですか?

答えて

1

URI /forums/sitemapindex.xmllocation ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ブロックで処理されていて、/forums/index.phpに転送されていないという問題があります。

静的な.xmlファイルを提供しない場合は、正規表現から|xmlという用語を削除するだけです。

そうしないと、たとえば、URIという特殊なケースを作成する必要があります。私は間違って書き換えに焦点を当てた

location = /forums/sitemapindex.xml { 
    rewrite^/forums/index.php?p=/sitemapindex.xml last; 
} 
+0

。どうも!これで解決しました。 –

関連する問題