The Apache Haus Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to Apache Haus Distribution Forum

Pages: [1]   Go Down

Author Topic: Permanent redirect to URL of new website (if user hits the URL of inactive site)  (Read 621 times)

userapache123

  • Newbie
  • *
  • Offline Offline
  • Posts: 1

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.

« Last Edit: August 13, 2021, 10:24:51 AM by mario »
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 886

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.
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 620

AdminNote: I Fixed the stuck in moderation issue on the DB level.
Logged
Pages: [1]   Go Up
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13