I'm trying to add some rules to an .htaccess file in a subdomain to:
I have the second part only:
# Redirect to /beta
RewriteEngine On
RewriteRule ^$ /beta [L]
I've seen a couple of examples here in StackOverflow but they seem to work only for domains, not subdomains. Any help would be appreciated.
To redirect old domain to new domain this should do:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.subdomain.domain.com$ [NC]
RewriteRule ^(.*)$ http://subdomain.domain.com/$1 [R=301]
Note that I omitted the L
directive here ([R=301,L]
) because you are probably going to add the second directive (/beta redirect) right after this.