Link to home
Start Free TrialLog in
Avatar of jckuffner
jckuffner

asked on

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

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!
Avatar of Bruce Smith
Bruce Smith
Flag of United States of America image

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

Avatar of jckuffner
jckuffner

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Bruce Smith
Bruce Smith
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks a lot for your help, this resolves my issue.
Cheers, glad to help.