Reputation: 45
I want convert links to another domain
From this : www.old.net/upload/namefolder/namefile.mp3
To : www.new.net/upload/namefolder/namefile.mp3
using .htaccess
How can I do this?
Upvotes: 1
Views: 32
Reputation: 99081
You can use something like:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.old\.net$ [NC]
RewriteRule ^(.*)$ http://www.new.net [R=301,L]
Upvotes: 2
Reputation: 15141
Try this hope it will work fine.
RewriteEngine On
RewriteCond %{REQUEST_URI} \.(?:mp3)$
RewriteCond %{HTTP_HOST} old\.net [nc]
RewriteRule ^(.*)$ http://www.new.net/$1 [R=301,L,QSA]
Upvotes: 2