I have two domains, the first one is payment.propnex.net and the second one is digi.propnex.net. I want the first domain to redirect me to the second domain immediately after visiting the url. How could I achieve that?
.htaccess from first domain
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^(.*)$ http://digi.propnex.net/%{HTTP_HOST}/$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
EDIT. I created new .htaccess
file in root directory of first domain and added
RewriteEngine On
RewriteCond %{HTTP_HOST} ^https://payment.propnex.net [NC,OR]
RewriteCond %{HTTP_HOST} ^http://digi.propnex.net [NC]
RewriteRule ^(.*)$ http://digi.propnex.net/%{HTTP_HOST}/$1 [L,R=301,NC]
Still when not redirecting