James Mallon
James Mallon

Reputation: 1127

Is it possible to point a full URL to another server?

Bit of a weird one.

One of my clients has a shared hosting server which he hosts his website on lets say:

http://www.example.com

To develop a web application for him I have had to use a different server lets say 255.255.255.255 which allows SSH access.

My client wants http://www.example.com/portal to essentially "point" or display the portal & web pages etc from server 255.255.255.255.

I know you can point domains but I have no idea where to start on something like this, any help or suggestions would be appreciated

J x

Upvotes: 0

Views: 676

Answers (3)

Dusan Bajic
Dusan Bajic

Reputation: 10869

Add this to .htaccess file placed in the root of the www.example.com site:

RewriteEngine On
RewriteRule ^portal/?(.*)$ http://255.255.255.255/$1 [P]

Upvotes: 0

user1263254
user1263254

Reputation:

A plain 301 redirect comes to mind:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} www.example.com/portal$ [NC]
RewriteRule ^(.*)$ http://255.255.255.255/$1 [L,R=301]

This should obviously go into the .htaccess on www.example.com

Upvotes: 1

Eugene Lisitsky
Eugene Lisitsky

Reputation: 12845

  1. Better: place it on a subdomain: http://portal.example.com

  2. Worse: proxy all request from http://www.example.com/portal to your site. But you need access to web server config - unlikely shared hosting will allow you to do it. Or you need your own hosting like VPS and so on.

Upvotes: 1

Related Questions