I’m having trouble redirecting my domain to a subdomain.

My domain is www.example.com and I want all traffic to go to aa.example.com. I’ve got my domain (www.example.com) and subdomain (aa.example.com) as two sites on a network in WordPress.

I tried the following code in htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?example.com$ [NC]
RewriteRule ^ http://new.example.com%{REQUEST_URI} [R=301,L,NE]

After setting the redirect I can’t access my network dashboard because an endless loop has been created, and I can’t access my domain (www.example.com/wp-admin) dashboard because it redirects to the subdomain dashboard.

Is there another way I can create the redirect without encountering these problems?

Read more here: Redirecting domain to subdomain with htaccess on a WordPress network


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: