?HOWTO redirect ChurchOfGod.Churches.org to www.Churches.org/ChurchOfGod

This is a discussion on ?HOWTO redirect ChurchOfGod.Churches.org to www.Churches.org/ChurchOfGod within the Apache Web Server forums, part of the Web Server and Related Forums category; Can you please describe a strategy for accomplishing the following? redirect http://ChurchOfGod.Churches.org to http:// www.Churches.org/...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-19-2003
Jones
 
Posts: n/a
Default ?HOWTO redirect ChurchOfGod.Churches.org to www.Churches.org/ChurchOfGod

Can you please describe a strategy for accomplishing the following?

redirect http://ChurchOfGod.Churches.org to http:// www.Churches.org/ChurchOfGod

  #2 (permalink)  
Old 07-19-2003
Robi
 
Posts: n/a
Default Re: ?HOWTO redirect ChurchOfGod.Churches.org to www.Churches.org/ChurchOfGod

Jones wrote:
> Can you please describe a strategy for accomplishing the following?
>
> redirect http://ChurchOfGod.Churches.org

to http://www.Churches.org/ChurchOfGod

check out http://httpd.apache.org/docs-2.0/misc/rewriteguide.html

search for "Virtual User Hosts" (without the quotes ;o)

HTH

--
Robi
  #3 (permalink)  
Old 07-19-2003
Russ Blakeman
 
Posts: n/a
Default Re: ?HOWTO redirect ChurchOfGod.Churches.org to www.Churches.org/ChurchOfGod

make sure the folder that "ChurchOfGod" is in is under the folder
(subdirectory basically) that "Churches.org" is in on your drive and when
the http://churches.org/churchofgod is typed into the browser it will pick
up the index,htm or html that is in the churchofgod sub-folder rather than
the index.htm/html that is in the churches.org folder.

You don't need a Virtual host setting for the /churchofgod folder then
either as you are going to a sunfolder of the churches.org virualhost.

To make a subdomain show as in subdomain.domain.net, subdomain2.domain.net,
etc you need to make sure that it's listed in DNS but the subdirectory of
http://domain.net/subdomain doesn't have to be, just the domain.net
reference.


"Jones" <jones@justjones.org> wrote in message
news:2n9hhvc8bdsarlpbip02dc20qrhn964c5a@4ax.com...
> Can you please describe a strategy for accomplishing the following?
>
> redirect http://ChurchOfGod.Churches.org to http://

www.Churches.org/ChurchOfGod
>



  #4 (permalink)  
Old 07-19-2003
Jones
 
Posts: n/a
Default Re: ?HOWTO redirect ChurchOfGod.Churches.org to www.Churches.org/ChurchOfGod

On Fri, 18 Jul 2003 22:15:23 -0500, "Robi" <r_buecheler@remove.yahoo.com> wrote:
>Jones wrote:
>> Can you please describe a strategy for accomplishing the following?
>> redirect http://ChurchOfGod.Churches.org

> to http://www.Churches.org/ChurchOfGod
>check out http://httpd.apache.org/docs-2.0/misc/rewriteguide.html
>search for "Virtual User Hosts" (without the quotes ;o)


thanks for getting me on the right track. It's late, and I haven't quite caught on to that yet.
Here's where I am:

#
# Use name-based virtual hosting.
#
NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.

<VirtualHost *>
ServerName churches.org
ServerAdmin root@localhost
DocumentRoot "/var/www/html"
ServerAlias churches.org www.churches.org ChurchOfGod.churches.org ChurchOfChrist.org
</VirtualHost>

<VirtualHost *>
ServerName www.churches.org
ServerAdmin root@localhost
DocumentRoot "/var/www/html"
ServerAlias churches.org www.churches.org ChurchOfGod.churches.org ChurchOfChrist.org
</VirtualHost>

<VirtualHost *>
ServerName ChurchOfGod.churches.org
ServerAdmin root@localhost
DocumentRoot "/var/www/html/ChurchOfGod"
ServerAlias churches.org www.churches.org ChurchOfGod.churches.org ChurchOfChrist.org
</VirtualHost>

<VirtualHost *>
ServerName ChurchOfChrist.org
ServerAdmin root@localhost
DocumentRoot "/var/www/html/ChurchOfChrist"
ServerAlias churches.org www.churches.org ChurchOfGod.churches.org ChurchOfChrist.org
</VirtualHost>

#<VirtualHost _default_:*>
#</VirtualHost>





  #5 (permalink)  
Old 07-21-2003
Jones
 
Posts: n/a
Default [mod_rewrite accomdating pre-existing virtual includes?] Re: ?HOWTO redirect ChurchOfGod.Churches.org to www.Churches.org/ChurchOfGod

On Fri, 18 Jul 2003 22:06:36 -0400, Jones <jones@justjones.org> wrote:
>Can you please describe a strategy for accomplishing the following?
> redirect http://ChurchOfGod.Churches.org to http:// www.Churches.org/ChurchOfGod

v
Per your hint to look at mod_rewrite to implement "User Virtual Hosts"
I was able to implement subdomains using that method, *but* I have
to duplicate the [unknown] way subdomains were implemented on another
box to accomodate someone else's code. This method resulted in an
extra subdomain name being put in all the includes and relative links,
so www.Churches.org/ChurchofGod works great, but ChurchofGod.Churches.org
gets me to the right subdirectory, but then all relative links and includes are
broken. that is: It results in includes which should look like this

.../images or ../includes

showing up in the error_log as file not found ../ChurchOfGod/images
or ../ChurchOfGod/includes, etc.
v
Is there another way? I need to 2nd guess someone else's implementation
of subdomains.

RewriteEngine on
RewriteCond %{HTTP_HOST} [^.]+\.churches\.org$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ([^.]+)\.churches\.org(.*) /$1$2

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:48 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0