I was wondering if the following scenario is possible using htaccess rules. I want one subdomain to be redirected to another url. I have contact the server admin to add the "test" subdomain to "example.com" domain. The main domain has no other subdomains.
What rule must i put in htaccess to do achieve: http://test.example.com to be redirected to http://www.something-else.com.
NOTE: www.something-else.com is a complicated url (200 chars length)
EDIT My full htaccess file now looks like:
Options +FollowSymLinks
RewriteEngine on
RewriteOptions inherit
RewriteBase /
RewriteCond %{HTTP_HOST} ^test.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/redir.php [L]
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
The htaccess file is located to example.com root directory. I have no physical access to test subdirectory, although i know it exists - ping to that url shows me the IP of example.com
Typing test.example.com to the browser's address bar has no effect. White screen, no redirection, no nothing. If some page exists there, i know not.
For static urls:
For Dynamic urls (if the original domain has folders that needs to be moved to the other domain):
From your edit: