Solved

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

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
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…
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…
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…

895 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

13 Experts available now in Live!

Get 1:1 Help Now