Solved

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

Posted on 2011-03-14
5
1,144 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:patsmitty
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:
patsmitty 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:patsmitty
ID: 35133415
Cheers, glad to help.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
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.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now