Permanent redirect - to active website (from inactive web)

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Permanent redirect - to active website (from inactive web)

Postby userapache123 » 12. August 2021 16:11

I am using Apache 2.4.47 Win64 from Xampp. Please suggest:
1) Which file in Apache to edit
2) And what to add/include in that file to accomplish the following.

A website e.g. https://www.old.com does NOT exist anymore (shut down/inactive).
Any user who wants to go to website https://www.old.com (because the old website might be bookmarked) will now be redirected to a new (and active) website, which is https://www.new.com

If a user has bookmarked the old website, or any sub-pages in the old website (e.g. bookmarked https://www.old.com/page1) will be just re-directed to the main entry page of https://www.new.com (or to https://www.new.com/page1)

The old website was cloned to a new domain (all the content and sub-URLs are the same). And after cloning, the old website was shut down and the new website was made active. However, the prior users have a bookmark of the old website and I would like them to get redirected to the new website, whenever they hit the URL of the old website. It is not possible to notify the users as the list of the users is not known. Redirect (permanent) will work the best.

Redirecting any page of the old website to the mapping page in the new website will be ideal, as:
https://www.old.com/? to https://www.new.com/?

If not, redirecting the context root of a.com to b.com will be acceptable.
Redirecting https://www.old.com/? to https://www.new.com/ will also be acceptable.
userapache123
 
Posts: 14
Joined: 06. May 2021 06:01
XAMPP version: xampp-windows-x64-7.4.16-0-VC1
Operating System: Windows

Re: Permanent redirect - to active website (from inactive we

Postby Nobbie » 12. August 2021 17:48

SImply

Code: Select all
Redirect / https://www.new.com/


In .htaccess file for DocumentRoot of https://www.old.com. Of course there must be any service at https://www.old.com in order to redirect to the new server. A simple Redirect does as well mapping as passing URL parameters (if necessary).
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Permanent redirect - to active website (from inactive we

Postby userapache123 » 12. August 2021 18:05

Hello Nobbie,
the old website is shut down (and Apache is also shut down). As such, any redirect change needs to be made in the Apache of the new site only.

I am using Apache 2.4.47 Win64 from Xampp. Please suggest:
1) Which file in Apache to edit
2) And what to add/include in that file to accomplish the following.

A website e.g. https://www.old.com does NOT exist anymore (shut down/inactive).
Any user who wants to go to website https://www.old.com (because the old website might be bookmarked) will now be redirected to a new (and active) website, which is https://www.new.com

If a user has bookmarked the old website, or any sub-pages in the old website (e.g. bookmarked https://www.old.com/page1) will be just re-directed to the main entry page of https://www.new.com (or to https://www.new.com/page1)

The old website was cloned to a new domain (all the content and sub-URLs are the same). And after cloning, the old website was shut down and the new website was made active. However, the prior users have a bookmark of the old website and I would like them to get redirected to the new website, whenever they hit the URL of the old website. It is not possible to notify the users as the list of the users is not known. Redirect (permanent) will work the best.

Redirecting any page of the old website to the mapping page in the new website will be ideal, as:
https://www.old.com/? to https://www.new.com/?

If not, redirecting the context root of a.com to b.com will be acceptable.
Redirecting https://www.old.com/? to https://www.new.com/ will also be acceptable.
userapache123
 
Posts: 14
Joined: 06. May 2021 06:01
XAMPP version: xampp-windows-x64-7.4.16-0-VC1
Operating System: Windows

Re: Permanent redirect - to active website (from inactive we

Postby Altrea » 12. August 2021 20:00

Hi,

The old URL MUST resolve to a Webserver you can control.
Which Apache is not important, but the old URL is important.
Otherwise you have no possibility to redirect anything.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Permanent redirect - to active website (from inactive we

Postby userapache123 » 12. August 2021 20:04

Hello Altrea,
The apache server of the old site is now shut down. If the user hits the old URL, it correctly states that the "site not found".

Is there any configuration possible only in the Apache server of the new wite so that the old URL gets redirected to the new URL?
userapache123
 
Posts: 14
Joined: 06. May 2021 06:01
XAMPP version: xampp-windows-x64-7.4.16-0-VC1
Operating System: Windows

Re: Permanent redirect - to active website (from inactive we

Postby Altrea » 12. August 2021 20:07

Did you still control the old URL and can resolve it to the new Apache?
If not than you have no possibility to configure anything.
No old URL = no redirect to the new URL.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Permanent redirect - to active website (from inactive we

Postby userapache123 » 12. August 2021 20:13

Hello Altrea,

I do not understand what you mean by "if I still control the old URL and the old Apache server". Are you asking if the Apache server in the old website is still active? The old website (and the apache in the old website) is now shut down.

Nobody can stop a user to hit the old URL (of the old server) but the apache (and the old website) is now shut down/turned off. So, if the user hits the old website, the user gets the site not found, which is correct.

Any option to make the change only in the Apache of the new server (the new Apache server is the only one that is active) so that if any user hits the old URL, it gets routed to the new URL?
userapache123
 
Posts: 14
Joined: 06. May 2021 06:01
XAMPP version: xampp-windows-x64-7.4.16-0-VC1
Operating System: Windows

Re: Permanent redirect - to active website (from inactive we

Postby Altrea » 12. August 2021 20:17

Easy speaking:
Do you still pay the old URL? If this is not your URL any more, you can do nothing.
If this is still your URL, you need to set an A-Record (or AAAA-Record) leading to the new Apache.
You must have the control to set the IP the old URL is resolved to.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Permanent redirect - to active website (from inactive we

Postby userapache123 » 12. August 2021 20:30

Hello Easy Speaking,
The old website (domain) is an internal website. The new website (domain) is also an internal website. Both are hosted in Apache. The difference is the Apache server of the old site is shut down. The Apache server of the new site is active.

User hitting the old URL gets the message as "site not found", and that is the correct behavior. Apache in the old website is shut down. I am not sure if you are asking me to make changes in the Apache of the old site, even though the Apache in the old site is shut down.

I am trying to understand if changes can only be made in the Apache server configuration of the new (active) site. Apache server is only running for the new site. Apache server for the old site is shut down.
userapache123
 
Posts: 14
Joined: 06. May 2021 06:01
XAMPP version: xampp-windows-x64-7.4.16-0-VC1
Operating System: Windows

Re: Permanent redirect - to active website (from inactive we

Postby Altrea » 12. August 2021 20:35

Last try to make it clear:

userapache123 wrote:I am not sure if you are asking me to make changes in the Apache of the old site,

No!

At very first you need to make sure that the old URL is resolved to the IP of the new Apache.
If this is a internal website like an company intranet than the URL is commonly resolved by a company DNS server.
In this case you need to edit the entry in this DNS Server.

You cannot do anything by Apache configuration as long as the requests cannot reach this Apache.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Permanent redirect - to active website (from inactive we

Postby Nobbie » 12. August 2021 23:00

userapache123 wrote:I am trying to understand if changes can only be made in the Apache server configuration of the new (active) site. Apache server is only running for the new site. Apache server for the old site is shut down.


No.

Why dont you get this? Who or what should tell the browser to go for new.com instead of old.com? Is it really so hard to understand for you that this is impossible? If there is not any service at old.com, you cannot redirect to new.com. Thats how it is and its really quite logical.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Permanent redirect - to active website (from inactive we

Postby gsmith » 13. August 2021 00:12

Your same post at Apache Haus is stuck in moderation hell and a bug in latest forum software version does not let it be approved. But still, I had the same questions.

On the DNS level (nothing to do with Apache), do you still control the DNS for the old domain. Can you make changes to it's DNS (A/CNAME/MX records)?

What you need to do first is change it so that old.domain.com points to the same IP as new.domain.com if it isn't already.

Now to us here internal means in house and not live on the internet so be careful when using that term. Would I be able to visit the URLs from my home if I knew them? If so it's not internal (even thought the server may be sitting on/under your desk, closet, spare room, etc).
gsmith
 
Posts: 278
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 10/2012R VS 14,15,16

Re: Permanent redirect - to active website (from inactive we

Postby Nobbie » 13. August 2021 09:38

gsmith wrote:What you need to do first is change it so that old.domain.com points to the same IP as new.domain.com if it isn't already.


Of course you can do so, but if you do, there is no need for any new.com, as old.com still resolves to the installed software. No redirect nessary, no new.com necessary. Actually nothing has changed besides the Server IP.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Permanent redirect - to active website (from inactive we

Postby Altrea » 13. August 2021 11:27

but maybe it is the goal to let the old domain die after a period of time, e.g. legal reasons or image reasons.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Permanent redirect - to active website (from inactive we

Postby Nobbie » 13. August 2021 11:50

Maybe.

But still, there wouldnt be any reason for any redirect. A warning or something else would be superior, because the user MUST update his favorites when old.com is supposed to die. A redirect still needs old.com. But the question actually was, how to avoid that users have to update their favorites. There is only one answer: old.com must survive. There is no alternative:

userapache123 wrote:Any user who wants to go to website https://www.old.com (because the old website might be bookmarked)


.... will get "server not found" if old.com dies.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 200 guests