新客戶端需要我的幫助,他們的Web開發人員搞砸了 - 在草稿/測試服務器上構建網站,但忘記阻止Google等。我很感謝這裏的社區幫助,我不是一位HTACCESS重定向專家。.htaccess從子域重定向到子域
正如我所說,另一個網站開發者在他們的服務器草案上設置了客戶端草稿站點,它在那裏呆了好幾個月,但是他們忘了隱藏搜索引擎,所以內容被谷歌等索引 - 這將觸發如果網站將新網站直播並且新網站無效,則會導致重複內容處罰。
我有權訪問草稿站點/服務器,並且可以修改HTACCESS文件,所以當新站點上線時,我想要正確的重定向。網站上有幾個子域名(這是一個多語言站點),所以它有點棘手。
該網站是建立在WordPress的
網站結構看起來像這樣的測試服務器上。所有文件頁面名稱和文件名稱都是相同的,只是轉移到新的服務器。
http://clientdomain.testserver.com
http://it.clientdomain.testserver.com
http://fr.clientdomain.testserver.com
http://es.clientdomain.testserver.com
http://de.clientdomain.testserver.com
http://ko.clientdomain.testserver.com
http://pt.clientdomain.testserver.com
http://ru.clientdomain.testserver.com
http://tr.clientdomain.testserver.com
http://cn.clientdomain.testserver.com
的重定向需要在這裏去:
http://clientdomain.com
http://it.clientdomain.com
http://fr.clientdomain.com
http://es.clientdomain.com
http://de.clientdomain.com
http://ko.clientdomain.com
http://pt.clientdomain.com
http://ru.clientdomain.com
http://tr.clientdomain.com
http://cn.clientdomain.com
在測試服務器上現有的.htaccess文件看起來像這樣
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule^- [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
我真的很感激有這方面的幫助。
有包含的.htaccess的所有謎題的碎片一些現有的線程,但我有點困惑:
如何從一個子域名重定向到另一個在.htaccess? How can I redirect from one subdomain to another in .htaccess?
親切的問候, GG
沒有必要去clientdomain.testserver.com後? – Croises 2015-02-05 14:16:49