Solved

How to Redirect Domains in Apache but keep vanity URL in original domain

Posted on 2011-03-14
5
1,185 Views
Last Modified: 2013-12-13
Hi

I would like to redirect a domain like so:

www.originaldomain.com to
www.newdomain.com/loginpage.jsp

I would like the url "www.originaldomain.com" to still be visible in the address bar, not the new domain. Is this possible with Apache or PHP?

Thanks!
0
Comment
Question by:jckuffner
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:Bruce Smith
ID: 35133235
Just off first glance since it's in the PHP zone, if you're keeping the old domain anyways, put the following code on the very first line of the old domain's root folder's index.php file:
 
<?php header('location: http://www.newdomain/loginpage.jsp'); ?>

Open in new window

0
 

Author Comment

by:jckuffner
ID: 35133304
Thanks, but this does not resolve the issue I'm concerned with, which is:

I would like the url "www.originaldomain.com" to still be visible in the address bar, NOT the new domain address.
0
 
LVL 11

Accepted Solution

by:
Bruce Smith earned 125 total points
ID: 35133332
Ohhh, I see. Put this in the head of your index on the old server:

<frameset rows="100%,*" border="0">
  <frame src="http://www.newserver.com/loginpage.jsp" frameborder="0" />
  <frame frameborder="0" noresize />
</frameset>

Open in new window

0
 

Author Comment

by:jckuffner
ID: 35133359
Thanks a lot for your help, this resolves my issue.
0
 
LVL 11

Expert Comment

by:Bruce Smith
ID: 35133415
Cheers, glad to help.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

825 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