Переписать пути ресурсов на новый поддомен

Мы перенесли основной сайт advancedbrain.comна новый сайт/сервер. Старый сайт по-прежнему обслуживает некоторые старые материалы. Теперь к нему можно получить доступ в этом поддомене: l.advancedbrain.com.

Многие старые страницы на старом сервере все еще ищут ресурсы, используя пути, такие как:

http://advancedbrain.com/components/com_ixxocart/images/buttons/en/buttonAddToCart.gif
http://advancedbrain.com/templates/abthome/images/abt_logo.png
http://advancedbrain.com/plugins/system/2j_tabs/2j_tabs.css
http://advancedbrain.com/components/com_ixxocart/content/ajax/xajax_js/xajax.js

так далее. так далее.

Я пытаюсь написать перезапись .htaccessтам, где он будет искать эти ресурсы l.advancedbrain.comвместо advancedbrain.com.

Я попробовал несколько вещей, но они не сработали.

1 ответ

  1. Наконец-то понял. Вот он в надежде, что поможет другим.

    RewriteEngine On
    
    RewriteRule "^/components/com_ixxocart/images/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/images/
    	

    Finally figured this out. Here it is in hopes it will help others.

    RewriteEngine On
    
    RewriteRule "^/components/com_ixxocart/images/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/images/$1" [NC,L,R=301]
    RewriteRule "^/templates/abthome/images/(.+)" "http://l.advancedbrain.com/templates/abthome/images/$1" [NC,L,R=301]
    RewriteRule "^/plugins/system/2j_tabs/(.+)" "http://l.advancedbrain.com/plugins/system/2j_tabs/$1" [NC,L,R=301]
    RewriteRule "^/components/com_ixxocart/content/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/content/$1" [NC,L,R=301]
    

    " [NC,L,R=301]
    RewriteRule "^/templates/abthome/images/(.+)" "http://l.advancedbrain.com/templates/abthome/images/

    Finally figured this out. Here it is in hopes it will help others.

    RewriteEngine On
    
    RewriteRule "^/components/com_ixxocart/images/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/images/$1" [NC,L,R=301]
    RewriteRule "^/templates/abthome/images/(.+)" "http://l.advancedbrain.com/templates/abthome/images/$1" [NC,L,R=301]
    RewriteRule "^/plugins/system/2j_tabs/(.+)" "http://l.advancedbrain.com/plugins/system/2j_tabs/$1" [NC,L,R=301]
    RewriteRule "^/components/com_ixxocart/content/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/content/$1" [NC,L,R=301]
    

    " [NC,L,R=301]
    RewriteRule "^/plugins/system/2j_tabs/(.+)" "http://l.advancedbrain.com/plugins/system/2j_tabs/

    Finally figured this out. Here it is in hopes it will help others.

    RewriteEngine On
    
    RewriteRule "^/components/com_ixxocart/images/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/images/$1" [NC,L,R=301]
    RewriteRule "^/templates/abthome/images/(.+)" "http://l.advancedbrain.com/templates/abthome/images/$1" [NC,L,R=301]
    RewriteRule "^/plugins/system/2j_tabs/(.+)" "http://l.advancedbrain.com/plugins/system/2j_tabs/$1" [NC,L,R=301]
    RewriteRule "^/components/com_ixxocart/content/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/content/$1" [NC,L,R=301]
    

    " [NC,L,R=301]
    RewriteRule "^/components/com_ixxocart/content/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/content/

    Finally figured this out. Here it is in hopes it will help others.

    RewriteEngine On
    
    RewriteRule "^/components/com_ixxocart/images/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/images/$1" [NC,L,R=301]
    RewriteRule "^/templates/abthome/images/(.+)" "http://l.advancedbrain.com/templates/abthome/images/$1" [NC,L,R=301]
    RewriteRule "^/plugins/system/2j_tabs/(.+)" "http://l.advancedbrain.com/plugins/system/2j_tabs/$1" [NC,L,R=301]
    RewriteRule "^/components/com_ixxocart/content/(.+)" "http://l.advancedbrain.com/components/com_ixxocart/content/$1" [NC,L,R=301]
    

    " [NC,L,R=301]