wordpress - .htaccess to change the domain in the URL -


i have following 2 wordpress sites.

  1. test.mysite.com
  2. mysite.com

the uploads(images) folder on mysite.com , want image urls test.mysite.com redirected mysite.com

for example link test.mysite.com/wp-content/uploads/2015/09/image.jpg should redirected mysite.com/wp-content/uploads/2015/09/image.jpg

i appreciate help.

if care website traffic , seo. recommend using 301 redirection is: redirectmatch permanent

it's quite easy! make new .htaccess file @ test.mysite.com > add chunk of codes bellow:

rewriteengine on

redirectmatch permanent ^/wp-content/uploads/(.*)$ http://mysites.com/wp-content/uploads/$1

now images should 301 seo redirected concerned location.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -