1

Let's say I have got 5 websites in the different hostings each.

I want to create a page for each of them but host them all together under a subdomain of ONE hosting, For example.

www.site1.com -> At hosting A www.site2.com -> At hosting B www.site3.com -> At hosting C www.site4.com -> At hosting D

www.site5.com -> At hosting E

Let's say I have got 5 websites in the different hostings each.

I want to create a page for each of them but host them all together under a subdomain of ONE hosting, For example.

www.site1.com -> At hosting A www.site2.com -> At hosting B www.site3.com -> At hosting C www.site4.com -> At hosting D

www.site5.com -> At hosting E

So :

Visiting www.site1.com should take you to what is in hosting A but if you visit www.site1.com/pageZ should take you to pages.site5.com/pageZ in hosting E(BUT YOU SHOULD STILL SEE THE SAME URL)

and the same for the rest... www.site2.com/pageY should take you to what is in pages.site5.com/pageY

how can I do that ?

Thomas Dickey
  • 8,632
  • 3
  • 22
  • 31
Ariel
  • 31
  • 2
  • If you need to clarify your original question, please edit the question. Asking the same question twice will just cause one of your questions to be put on hold. – heavyd Jul 08 '15 at 20:38

1 Answers1

0

Apache mod_rewrite is for you, the "Rewrite" methods combined with regular expressions should feat your needs perfectly

create a ".htaccess" file in your public dir at hosting A for example

insert this lines :

<IfModule mod_rewrite.c>
    RewriteEngine On

    # redirect pageZ to http://pages.site5.com/pageZ
    # http://www.site1.com/pageZ redir to http://pages.site5.com/pageZ
    RewriteRule ^(pageZ)$  http://pages.site5.com/$1

    # redirect pageY to http://pages.site5.com/pageY
    RewriteRule ^(pageY)$  http://pages.site5.com/$1

    # calling any url starting with "page" and followed by any caracter
    RewriteCond %{REQUEST_URI} ^(page.)$
    # then redirect the uri to the following
    RewriteRule ^(.*)$ http://pages.site5.com/$1 [L]

</IfModule>

You can find a guide at : https://httpd.apache.org/docs/2.0/misc/rewriteguide.html

pit
  • 171
  • 1
  • 3