Link to home
Start Free TrialLog in
Avatar of Kapila Jayasinghe
Kapila JayasingheFlag for Australia

asked on

URL alias/redirect while preserving origin name

Hello Experts,

I have www.mysite.com and ww2.mysite.com

Is there a way to alias/redirect www.mysite.com/portal to ww2.mysite.com/portal and mask ww2 with www?

CentOS 7/ Apache2
Avatar of David Favor
David Favor
Flag of United States of America image

Simple way... which might or might not be what you're after...

Redirect 302 / ww2.mysite.com/portal/

Open in new window

Avatar of Kapila Jayasinghe

ASKER

Hello David,

That would be as follows, in .conf in ww1?

Redirect 302 /portal ww2.mysite.com/portal/

Open in new window


What I'm trying to achieve is the client URL to be presented in browser as "www.mysite.com/portal (instead of "ww2.mysite.com/portal)
I do not think a redirect will do what you want because a redirect can only tell the browser to go to another address. It does not mask the address of the final destination. To be clear, you want me to type www.mysite.com into my address bar but you are actually serving up a site from ww2.mysite.com but you want me to see the www and not the ww2? www & ww2 are the same physical site on teh same server and the same IP right?

I think you will need to go deeper into some Apache Rewrite rules, if the content is truly the same site. If you are actually serving up pages from a different host, you may need to look more at DNS Spoofing or Domain Forwarding. These two options can also work if the content is the same site as well.
Thanks for your input Gregory. www and ww2 are hosting the same content in two physical locations. For some time ww2 will host the portal as well. I believe a DNS solution would do the trick. Let me investigate few options.
Likely good you try explaining what you're trying to accomplish here... because...

If you actually host same content on www + ww2, then Google will eventually find this, then assign what's called a site wide duplicate content penalty which will effectively drop your site out of organic search results.

Best consider well what you're trying to accomplish before running a multi instance site.

If you're trying to improve performance, consider this.

Most of my WordPress sites run at 1,000,000+ requests/second, before I deploy them.

I use this as an example because, likely better to just fix your site performance, rather than trying to load balance with multiple site instances... if you're trying to do load balancing...
We are migrating the site to new hosting. Portal migration hit a bump related to database connectivity issues. The above mentioned scenario is for few days until we sort out the database. Eventually we will end up with one site, www.
The easy answer is to do it all in DNS. The sites should both be setup as www.mysite.com and you should only need to change the DNS entry. To facilitate rapid propigation, reduce the TTL for the specific entries to the shortest time allowed by your DNS provider.
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
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
Hello All,

Thanks for your valuable advice. We have finished the migration and only the www site is live. Steve's suggestion was helpful.

Cheers,