Solved

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

Posted on 2011-03-14
5
1,207 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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 count occurrences of each item in an array.

735 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