Solved

host name for forum

Posted on 2006-11-20
18
328 Views
Last Modified: 2010-03-04
hello,
I have a forum on my server like domain.com/forum
how can I do so that when ever someone types
forum.domain.com it goes to domain.com/forum
can someone help me ?
thanks
0
Comment
Question by:Sabrin
  • 7
  • 6
  • 5
18 Comments
 
LVL 13

Expert Comment

by:rhickmott
ID: 17986022
You need to contact whoever is in control of your domain and get them to point a sub domain of forum.domain.com at your web servers IP address. (it may already be set there as a default).

you will then need to get whoever handles your web server to set up records so that forum.domain.com points at the correct folder. Most providers will supply a control panel for setting up sub domains have a look though the options.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 17987943
rhickmott is quite correct - there are two aspects to getting the subdomain pointing to your forum.

(1) First, you must set up DNS entries so that forum.domain.com resolves ot the webserver in question

(2) Secondly, you must instruct the web server to understand how to respond.

There are multiple ways of accomplishing(2), however.  You could install your forum into an entirely diffrerent hosting space from domain.com; or you could simply set up forum.domin.com to forward to domain.com/forum via a permanent redirecton.
0
 

Author Comment

by:Sabrin
ID: 17988717
yeah, of course i know that I have to do those two things
the reason why im here is because I want to know how!
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:Sabrin
ID: 17988722
the forum.domain.com points to the ip already so i need just the second one!
0
 
LVL 15

Accepted Solution

by:
periwinkle earned 500 total points
ID: 17988757
Sabrin - I certainly didn't mean to insult your intelligence - not everyone would realize those two things.

Easiest method would be to add a entry to your httpd.conf file which is:

<VirtualHost xxx.xxx.xxx.xxx:80> (or whatever convention you use)
ServerName forum.domain.com
Redirect Permanent / http://domain.com/forum 
</VirtualHost>

Then restart the apache webserver.

If you do not have access to the httpd.conf file, but are able to use mod_rewrite and overrides are enabled, write back, and we'll show you the entries for the .htaccess file that you'd need to do a conditional mod_rewrite.
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17988758
Well its quite an extensive question.

You can read up all day on DNS and still scratch the surface ditto Apache.

I guess the key questions are

Do you own your own web server or is it hosted by someone else?
What web server are you using?
Who did you register your domain with?

Normally most domain registers have a control panel where you can log in to control the Naming Records of your domain. If you look you will probably have a record saying something along the lines of

-          domain.com     A     xxx.xxx.xxx.xxx
www    domain.com    A    xxx.xxx.xxx.xxx
mail      domain.com   mx 10  xxx.xxx.xx.xxx

You need to add another "A" record for the sub domain forums and point them at your "WWW" or "-" IP Address. This will handle the domain side. If you have hosting with someone and they registered your domain they may do this for you but you will also need to speak to them to get the sub domain hosted. if its your own server you will need to edit the config files again we will need to know what server to assist. Some hosting companies have their own control panel allowing you to set up new sub domains easily and are relativity idiot proof.


0
 

Author Comment

by:Sabrin
ID: 17988796
periwinkle I dont have access to the httpd.conf
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17988800
Ok no problem :) if the sub domain is already set up and im guessing Apache then basically use periwinkles code above.

If you don't have any current virtual hosts you might need to set up Name Based Hosting.

Right at the bottom of your HTTPD.CONF file do


NameVirtualHost *:80

<VirtualHost *:80>
     # Do Nothing ( Will Use Main Server Settings )
</VirtualHost>

<VirtualHost *:80>
      ServerName forum.domain.com
      Redirect Permanent / http://domain.com/forum 
</VirtualHost>

As periwinkle said you will need to change * to whatever ip/naming/port your using.
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17988825
Ok then you will need to handle the redirect via .htaccess or get your hosting provider to set up the domain redirect for you.

In your root add a file called .htaccess with the following.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^forum\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://www.mysite.com/forum/$1 [R=301,L]
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 17988841
Without access to the httpd.conf, you can try using mod_rewrite.  In the file called .htaccess in the root of your website (which you can create if it doesn't exist), place the following lines:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^forum\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/forum$ [R=301]

This basically will look for a the domain name being forum.domain.com and force it to redirect to domain.com/forum.

0
 
LVL 15

Expert Comment

by:periwinkle
ID: 17988848
rhickmott's is a little bit better - that will pass any additional lines, like:

http://forum.domain.com/something will go to http://domain.com/forum/something.
0
 

Author Comment

by:Sabrin
ID: 17988961
ok I tried with both and none of them are working!!
0
 

Author Comment

by:Sabrin
ID: 17988973
everytime I type forum.domain.com
is like if I was just going to the ip http://67.12.23.34
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 17988976
are you receiving an error of any sort, or is it just going to the front page of domain.com?

Is there any information in your access_log or error_log?
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 17988996
RE: everytime I type forum.domain.com
is like if I was just going to the ip http://67.12.23.34

Is 67.12.23.34 the IP address that domain.com and forum.domain.com points to?  Is it the proper site at domain.com, or is it a different site?

If it is the same IP address as domain.com, but you aren't receiving the domain.com website, then there are multiple virtual servers set up at that IP address, and you will need to get your ISP to set up a subhosting account for you.
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17989003
How long ago did you set up the pointer for forums?

When you change DNS records it takes about 24 hours to 48 hours to update successfully. If its been longer than this then they this wont be an issue.

try a ping on forums.domain.com and see what IP it resolves to and what response you get. If it replys with the right IP then what do you get when you goto http://forums.domain.com/ if its your normal document root then the code *should* work unless your hosting company have disallowed it. If it doesent resolve to anything then you will prob have to contact your hopst to get them to set-up the sub domain for you.


0
 

Author Comment

by:Sabrin
ID: 17989010
I sent an icq to the admin with your code and he said ok !
thanks
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 17989031
Glad to have helped!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question