Help needed- subdomains

Discussion in 'Apache' started by arun10427, Apr 12, 2010.

  1. #1
    Hi,

    I have a subdomain named http://arun.rocks.com and another domain named www.rocks.com/projects/main.php/. I want my subdomain to always redirect to www.rocks.com/projects/main.php/. How to do this? Kindly help
     
    arun10427, Apr 12, 2010 IP
  2. coffear

    coffear Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #2
    you could use mod_rewrite in a htaccess file.

    Simply place a .htaccess file in the root folder for arun.rocks.com with the following content :-

    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^arun.rocks.com [NC]
    RewriteRule ^(.*)$ [url]http://www.rocks.com/projects/main.php/[/url] [L,R=301]
    Code (markup):
     
    coffear, Apr 13, 2010 IP