MilesWeb
MilesWeb Hosting Forum

Please login or register.

Login with username, password and session length

 

News:

SMF - Just Installed!


Author Topic: How to domain or subdomain point to different ports ?  (Read 3588 times)

0 Members and 1 Guest are viewing this topic.

Offline Dipak Bhoi

  • MilesWeb Team Member
  • Full Member
  • ***
  • Posts: 208
  • Karma: +5/-0
    • View Profile
    • MilesWeb Internet Services
How to domain or subdomain point to different ports ?
« on: August 17, 2014, 07:02:30 PM »
Hello guys,

If you want to domain or subdomain to be forwarded to the different port for different service then this post will help you. Follow the following instructions.

There are two ways to do this. You could use the VirtualHost section of your httpd.conf or you could do it in your .htaccess file.

In httpd.conf:

Quote
<VirtualHost *:80>
    ServerName subdomain.mydomain.com
    redirect / http://mydomain.com:4040/
</VirtualHost>

In .htaccess: Set redirect rule

Quote
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain\.mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://mydomain.com:4040/$1 [R=301]

Enjoy !!!


« Last Edit: August 17, 2014, 07:08:31 PM by Dipak Bhoi »
MilesWeb.com
cPanel Hosting in India - cPanel Hosting in India.

Grab an SSL for your website and SAVE 20% now. Coupon Code SSLSAVE20.

MilesWeb Hosting Forum

How to domain or subdomain point to different ports ?
« on: August 17, 2014, 07:02:30 PM »