views:

93

answers:

1

I want to redirect a praticular subdomain to the main domain

http(s)://dl.example.com/par1/par2 to http(s)://www.example.com/par1/par2

How to achieve the above using .htaccess

Why i want to do this: Whenever any user download a file from my server, if the file is huge , then user cannot do any other operation until the file is downloaded completely...so the solution that i have thought is to forward the download request through subdomain so that the browser may continue with rest of the operation.

Thanks

A: 

Except from my comment above a Rewrite would like this

RewriteEngine On
Rewritecond %{HTTP_HOST}   ^dl\.example\.com$ [NC]
RewriteRule ^/$1$       http://www.example.com/$1 [R,L]

Something like this should work, for more info see here mod_rewrite

asrijaal
not working for me....dl.example.com redirects to www.example.combut dl.example.com/par1/par2 does not redirect..
RJ