How do I create redirect to subdomain

New to apache

From scrolling the web I redirected all http://domain.com to http://www.domain.com.  However, now I need to, in addition, redirect http://www.domain/subdomain/ to http://subdomain.domain.com.


is this something I can do with .htaccess?
Charles BaldoSoftware DeveloperAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ncooConnect With a Mentor Commented:
Create an htaccess file:

".htaccess"

Add the following and upload it to domain.com/.htaccess

redirect 301 /subdomain http://subdomain.domain.com.

Open in new window

0
 
Charles BaldoSoftware DeveloperAuthor Commented:
Thnaks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.