www1 from old JR4 cluster setup - htaccess or DNS edit?

iLoveHouseMusic
iLoveHouseMusic
@ilovehousemusic
10 years ago
517 posts
Hello,
My old JR4 site was clustered, and there are still some links on the internet that point to the old "www1.domain.com/username" structure.

what htaccess or DNS edits can I make such that if a link with "www1" is clicked, my new JR5 site will pick that up, and convert it from "www1" to "www"?

For example, here's an old link:
JR4 - http://www1.ilovehousemusic.com/Michelle-Sanz/

And here's the JR5 link:
JR5 - https://www.ilovehousemusic.com/Michelle-Sanz/

But - You'll see when it redirects to the JR5 site, the URL changes to what you see in the attached file.

Thank you for your time,
Brian



updated by @ilovehousemusic: 05/11/14 09:01:01PM
michael
@michael
10 years ago
7,715 posts
This help?
http://stackoverflow.com/questions/4159088/how-to-modify-htaccess-file-to-always-redirect-to-www#4159124

Quote:
Add something like this immediately after RewriteEngine on:

RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^(.*) http://www.example.com/$1 [R=301]

it was for "how to modify .htaccess file to always redirect to www" but the concept is the same for www1
brian
@brian
10 years ago
10,148 posts
You should be able to to add "www1.ilovehousemusic.com" as a ServerAlias in your Apache config file for your domain. Then use the technique Michael has outline to check for www1 and rewrite it to www.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 04/10/14 06:40:04AM
iLoveHouseMusic
iLoveHouseMusic
@ilovehousemusic
10 years ago
517 posts
Let me give that a shot. Thanks guys!

Tags