Permanent redirect to URL of new website (if user hits the URL of inactive site)

Started by userapache123, August 12, 2021, 07:44:47 PM

Previous topic - Next topic

userapache123

ADMIN EDIT: This thread seems to be stuck in moderation hell and I have no idea how to get it Approved since I follow the docs but still it does nothing.

The old website is shut down and inactive (and Apache is also shut down for the old website). If a user attempts to try the URL of the old website, the user duly gets the message as website not found - and this is indeed the expected behavior.

What I wish to have is:
Any user attempting to go to the old website (or any sub-page of the old website) will now be redirected to the new website (only the new website is active, the old website is shut down). And any change in the Apache needs to be made in the Apache of the new website only.

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

If not, redirecting the context root of a.com to b.com will be acceptable.
Redirecting hxxps://www.old.com/? to hxxps://www.new.com/ will also be acceptable.


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



Scenario:

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

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


Gregg

Need more info.

1. Is the old domain name still registered to you?
2. Do you still have valid certficates fo https://old.domain.com?
3. Is the old domain pointing to the same IP as the new?
4. What have you changed to conf/httpd, conf/extra/httpd-ssl & conf/extra/httpd-vhosts .conf files.

I understand the problem but not knowing how you configured apache it is hard to tell you what you need to do.

Also consider this, a Redirect permanent doesn't change peoples bookmarks, only they can do that. I think instead I would have them land on a special page that specifically tells them your site has moved with a link to the new URL and ask them to update their bookmark for it. Like used to be done in the old days. It gives them a heads up. See once the old domain is no longer available they are going nowhere. Now this doesn't mean you have to bring the old server online. Hence question 3.

mario