Mobile app version of vmapp.org
Login or Join
Kevin317

: Why doesn't htaccess redirect domain alias to a specific url? I have this which i can't get to work RewriteEngine On RewriteCond %{HTTP_HOST} ^domainalias.com$ [OR] RewriteCond %{HTTP_HOST} ^www.domainalias.com$

@Kevin317

Posted in: #Htaccess

I have this which i can't get to work

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domainalias.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domainalias.com$
RewriteRule ^(.*)$ www.maindomain.com/specific-url/ [R=301,L]


it doesn't redirect to /specific-url/
any ideas?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kevin317

1 Comments

Sorted by latest first Latest Oldest Best

 

@LarsenBagley505

If you're looking to redirect a user from an old domain to a new domain on a specific page, you can use this:

======= update ========

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?domainalias.com [NC]
RewriteRule ^(.*)$ maindomain.com/specific-url/ [R,L]


or

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domainalias.com$ [NC]
RewriteRule ^(.*)$ www.maindomain.com/specific-url/ [R=301,L]


========= ### =========

You can also redirect using a meta tag:

<meta http-equiv="refresh" content="0; url=http://www.example.org/newpage.html">

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme