2014-11-08 52 views

回答

1

您可以在DOCUMENT_ROOT/.htaccess文件中使用此代碼:

RewriteEngine On 

RewriteCond %{HTTP_HOST} ^(?:www\.)?(domain1)\.com$ [NC] 
RewriteRule ^sitemap\.xml$ /%1.com/custom_websites.xml [L,NC,R=302] 
+0

你有沒有向相反的方向寫要求?你可能想要:'http://domain.com/domain.com/custom_websites.xml => http:// domain.com/sitemap.xml' – anubhava 2014-11-08 18:57:43

+0

但這就是你想要寫的問題。 – anubhava 2014-11-08 19:02:06

+0

它的作品謝謝你。 – Florin 2014-11-08 19:27:37