Solved

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

Posted on 2011-03-14
5
1,237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article discusses how to implement server side field validation and display customized error messages to the client.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

624 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