How can I redirect a subdomain to a specific URL?

440 views Asked by At

I am updating the Iirf.ini file to redirect sub.columbia.edu to giving.columbia.edu/video.

sub.columbia.edu is already redirecting to giving.columbia.edu. How can I go one step further to redirect it to giving.columbia.edu/video.

Important Note: I would like the URL to show as sub.columbia.edu in the browser and not as giving.columbia.edu/video

#Redirect subdomain to specific URL
RewriteCond %{HTTP_HOST} ^sub\.columbia\.edu
RewriteRule ^/$ /video

The above doesn't work. Any ideas how I should modify this?

Thank you!

1

There are 1 answers

3
Panama Jack On

You can try this and see how it works for you.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub\.columbia\.edu
RewriteRule ^(.*) http://giving.columbia.edu/video [L,R=301]

Or you can do a redirect, this should work also.

Redirect 301 / http://giving.columbia.edu/video