Apache Redirect Message
by LinuGeek from LinuxQuestions.org on (#532F5)
Hello Experts,
I am in the middle of setting up new website for our department and wished to know how we can redirect original website having same webaddress on a new server.
We have new website running on SLES 15 and Apache 2.4
So far I am able to setup the apache server and the new website works just fine. Lets say https://newaddress/subdir and it displays the contents correctly. Now I wish to setup a Redirect so that any clicks on the old website https://oldaddress/subdir will be redirected to a new ones with a Message (Popup or so) informing the users that there is now a new Website available.
For the redirection part i used .htaccess file and placed it in Quote:
.htaccess -->
Quote:
It works so far. But the Popup window, is where I require mainly the guidance. So we should be setting up ErrorDocument for this?
Or is there any better way?
Thanx.
-Admin


I am in the middle of setting up new website for our department and wished to know how we can redirect original website having same webaddress on a new server.
We have new website running on SLES 15 and Apache 2.4
So far I am able to setup the apache server and the new website works just fine. Lets say https://newaddress/subdir and it displays the contents correctly. Now I wish to setup a Redirect so that any clicks on the old website https://oldaddress/subdir will be redirected to a new ones with a Message (Popup or so) informing the users that there is now a new Website available.
For the redirection part i used .htaccess file and placed it in Quote:
/srv/www/htdocs |
Quote:
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteRule ^(.*)$ https://newaddress/subdir/$1 [R=301,L] </IfModule> |
Or is there any better way?
Thanx.
-Admin