0

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?

Server var/www/html enter image description here

.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

Vincent Dave Te
  • 218
  • 1
  • 15
  • Does this answer your question? [htaccess: redirect all requests to different domain (without query arguments)](https://stackoverflow.com/questions/3255967/htaccess-redirect-all-requests-to-different-domain-without-query-arguments) – Don't Panic Dec 03 '19 at 09:47
  • The easiest way it put a meta tag on `payment.propnex.net`page that user access – Truong Dang Dec 03 '19 at 09:48
  • what do you mean by that @TruongDang –  Dec 03 '19 at 09:55
  • @Don'tPanic i already did that i write new `.htaccess` file in root directory of first domain and still nothing –  Dec 03 '19 at 09:56
  • Really? Your question does not mention that? Can you show us? `still nothing` - what does that mean? What happens? What does devtools show? Apache logs? – Don't Panic Dec 03 '19 at 09:57
  • when i visit `payment.propnex.net` it still not redirect to `digi.propnex.net` –  Dec 03 '19 at 09:58

0 Answers0