I have a link displaying an image on my site which is from www.somedomain.com/image.jpg
How can I mask the domain so that it is www.mydomain.co.uk/image.jpg ?
Would this be done using mod_rewrite?
Thanks
I have a link displaying an image on my site which is from www.somedomain.com/image.jpg
How can I mask the domain so that it is www.mydomain.co.uk/image.jpg ?
Would this be done using mod_rewrite?
Thanks
This will rewrite all calls from your domain.
RewriteCond %{HTTP_HOST} ^www.somedomain.com$
RewriteRule ^(.*)$ http://www.mydomain.co.uk/$1 [R=301,L]
If you want to redirect all images, you can specify them by extension in the regex.
RewriteCond %{HTTP_HOST} ^www.somedomain.com$
RewriteRule ^(.+\.(?:jpg|gif|png))$ http://www.mydomain.co.uk/$1 [R=301,L]