Solved

host name for forum

Posted on 2006-11-20
18
325 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
 

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Ubuntu 14 with Apache 7 68
ports for sccm 2012 1 64
linux apache localhost dev laptop 5 34
whm high memory usage in processes 7 40
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now