Jump to content

Recommended Posts

Posted

Hi we have a Ubuntu server which is our web server which hosts the school website along with some other web type things.

 

I have a question regarding forwarding requests to another site which sits on the sub level of htdocs

 

Our current site can be access at http://www.schoolname.bham.sch.uk but a joomla site has been created and sits in /var/www/joomla and we now want this website to be active when external users hit http://www.schoolname.bham.sch.uk

 

It may be a simple question but how do we forward all requests to http://www.schoolname.bham.sch.uk/joomla. We rather they go to http://www.schoolname.bham.sch.uk and it automatically forwards to http://www.schoolname.bham.sch.uk/joomla

 

Any help would be greatly appreciated.

 

Thanks

Posted (edited)
Hi we have a Ubuntu server which is our web server which hosts the school website along with some other web type things.

 

I have a question regarding forwarding requests to another site which sits on the sub level of htdocs

 

Our current site can be access at http://www.schoolname.bham.sch.uk but a joomla site has been created and sits in /var/www/joomla and we now want this website to be active when external users hit http://www.schoolname.bham.sch.uk

 

It may be a simple question but how do we forward all requests to http://www.schoolname.bham.sch.uk/joomla. We rather they go to http://www.schoolname.bham.sch.uk and it automatically forwards to http://www.schoolname.bham.sch.uk/joomla

 

Any help would be greatly appreciated.

 

Thanks

 

DNS A RECORD

 

WEBHOST PANEL > DNS A RECORD > POINT TO SERVER IP

Edited by ahuxham
Posted

Apache 1.3 URL Rewriting Guide

 

Moved DocumentRoot

 

Description:

Usually the DocumentRoot of the webserver directly relates to the URL ``/''. But often this data is not really of top-level priority, it is perhaps just one entity of a lot of data pools. For instance at our Intranet sites there are /e/www/ (the homepage for WWW), /e/sww/ (the homepage for the Intranet) etc. Now because the data of the DocumentRoot stays at /e/www/ we had to make sure that all inlined images and other stuff inside this data pool work for subsequent requests.

Solution:

We just redirect the URL / to /e/www/. While is seems trivial it is actually trivial with mod_rewrite, only. Because the typical old mechanisms of URL Aliases (as provides by mod_alias and friends) only used prefix matching. With this you cannot do such a redirection because the DocumentRoot is a prefix of all URLs. With mod_rewrite it is really trivial:

 

  RewriteEngine on
   RewriteRule   ^/$  /e/www/  [R]

 

Any use?

Posted

Still need a DNS A RECORD for all this, fair enough creating virtual directories and URL Rewriting, but you still need to foward schoolname.bham.sch.uk/joomla to the correct server.

 

I know our *.sch.uk is controlled by RM, others may be LEA, and the likes.

 

Say, your external IP address is 84.84.84.84, you'll want to redirect sch.uk/joomla to 84.84.84.84, from their in, you can redirect the traffic to the server. Virtual directory will than kick in and feed the Joomla website.

Posted
Still need a DNS A RECORD for all this, fair enough creating virtual directories and URL Rewriting, but you still need to foward schoolname.bham.sch.uk/joomla to the correct server.

 

I know our *.sch.uk is controlled by RM, others may be LEA, and the likes.

 

Say, your external IP address is 84.84.84.84, you'll want to redirect sch.uk/joomla to 84.84.84.84, from their in, you can redirect the traffic to the server. Virtual directory will than kick in and feed the Joomla website.

 

Please, learn about the purpose of DNS, and read the OP. DNS is not for redirecting sub-directories, but for finding machines.

 

RabbieBurns is correct, those two line in your httpd.conf will be fine. They should be wrapped in IfMod statements too for safety, which you can find in the documentation.

Posted (edited)
Please, learn about the purpose of DNS, and read the OP. DNS is not for redirecting sub-directories, but for finding machines.

 

RabbieBurns is correct, those two line in your httpd.conf will be fine. They should be wrapped in IfMod statements too for safety, which you can find in the documentation.

 

Don't be patronising, take your elitist response elsewhere. No need to talk to me like that. I know how it works.

 

Typing: schoolname.sch.uk/joomla into google IS NOT going to redirect to an internal server in the school unless it already is setup that way. Many a school don't host their own websites.

 

EDIT: As an example: http://eportal.ourschool.sch.uk/ is a DNS A Record, pointing to our internal server, same can be said for ourschool.sch.uk/eportal

Edited by ahuxham
Posted

This person can get onto his site my putting in OpenDNS but he wants the ability just to put OpenDNS this is something to be done on the server. You can do it my a virtual apache server or what rippleburns says.

 

The face he can get onto the site by putting OpenDNS indicates his DNS is fine

Posted
Hi we have a Ubuntu server which is our web server which hosts the school website along with some other web type things.

 

In this case, the OP is clearly already hosting his own site, and the new site is going on the same box, so DNS is irrelevant. All he wants to do is make people arriving at / get a redirect to /joomla by HTTP.

 

I'm not intending to be patronising, but you're giving incorrect advice and insisting on it. If the OP doesn't understand DNS as well as you and I, and goes away and tries to figure it out by himself, it'll probably break what's already in place anyway. Complicating the problem doesn't help anybody, I don't see what's elitist about that.

 

I don't see what Google has to do with it, either.

Posted
In this case, the OP is clearly already hosting his own site, and the new site is going on the same box, so DNS is irrelevant. All he wants to do is make people arriving at / get a redirect to /joomla by HTTP.

 

I'm not intending to be patronising, but you're giving incorrect advice and insisting on it. If the OP doesn't understand DNS as well as you and I, and goes away and tries to figure it out by himself, it'll probably break what's already in place anyway. Complicating the problem doesn't help anybody, I don't see what's elitist about that.

 

I don't see what Google has to do with it, either.

 

Mistype on my part, and the elitist comment still stands, its not what was said, its the manner that you informed me.

 

However, reading the quote would imply that schoolname.sch.uk is currently redirecting to the internal server. Than DNS is fine, I read the original post with the opposite infact.

Posted
Still need a DNS A RECORD for all this, fair enough creating virtual directories and URL Rewriting, but you still need to foward schoolname.bham.sch.uk/joomla to the correct server.

 

Mistype on my part, and the elitist comment still stands, its not what was said, its the manner that you informed me.

 

No offence intended.

 

The point was and still is that DNS only takes care of the first bit off the quoted address. DNS doesn't know or care about /joomla. What irritated me was that other posters already pointed this out, but you still posted it again with emphasis.

 

But you are right, I was brusque about it (perhaps I have been re-factoring other people's bad code for too long already today). So for that, I'm sorry. And now this thread is so far off topic, let's shake and make up and forget it.

Posted

You need to edit a file in the etc/apache2/sites-available, called default i believe, in there you should see a reference to var/www that is just the root folder of your virtual apache host, change that to whatever directory path your new site is located in.

 

for example the file will look like (but with a lot more in the centre)

 

DocumentRoot var/www

ServerName http://www.schoolname.bham.sch.uk

 

 

The document root (in bold here) is the one you want to edit with the directory you need it to refer to. /var/www/joomla

 

I have tested this on my machine at home and it works with no issues, you can also add subdomains ie vle.schoolname.bham.sch.uk etc if your DNS server will able to forward wildcards.

 

Below is the article I used to learn these parts of Apache2, its pretty simple when you get your head round it!

 

VirtualHost Examples - Apache HTTP Server

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...