2011-09-23 57 views
0

我有幾個域擴展,我想重定向到特定頁面。 像example.de必須重定向到example.de/de/和example.fr到example.fr/fr/。正則表達式 - URL擴展重定向幫助

我該如何做到這一點?我是新來的正則表達式。

+0

在哪裏做這種重定向?在服務器端代碼(什麼語言?),客戶端(JavaScript?)或Web服務器配置? –

+0

最好.htaccess – priktop

回答

0

您將編輯.htacess文件,並把像到:

RedirectMatch permanent example\.de/$ http://example.de/de 
RedirectMatch permanent example\.fr/$ http://example.fr/fr 
.... 
+0

謝謝,但它不工作:(它停留在.de。 – priktop

+0

嘗試再添加兩行:'RedirectMatch永久示例\ .de $ http://example.de/de RedirectMatch永久示例\ .fr $ http:// example.fr/fr' ?? –

+0

仍然沒有運氣:( – priktop