0

I'm trying to setup a rule in the .htaccess file to allow me to add the 'something' to my website url, like this: something.mywebsite.com redirect to some subdirectory.

I have other rewrite conditions inside my .htaccess file already

Can you do this via .htaccess?

Crizly
  • 971
  • 1
  • 12
  • 33

1 Answers1

0
RewriteBase /
RewriteCond %{HTTP_HOST} ^subdomain.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/somesubdomain [R=301,L]
  • Could you please [edit] in an explanation of why this code answers the question? Code-only answers are [discouraged](http://meta.stackexchange.com/q/148272/274165), because they don't teach the solution. – Nathan Tuggy Jul 31 '15 at 01:21