How to redirect old folder to new with .htaccess but exclude subdomains?

  .htaccess, apache, wamp, webserver, windows

I’m trying write rules on my .htaccess file to redirect my old website to the new one which is a subfolder
So, for example, i want to redirect from domain.com to domain.com/new.

What happens is that i want to keep accessing the other folders, for example: domain.com/folder1 or domain.com/folder2 but instead, it keeps redirecting to domain.com/new.

Also, i have subdomain that already have their own redirect rule and is working fine, i want to keep my subdomains intact. like: sub1.domain.com and sub2.domain.com

Basically, i need this:
domain.com go to -> domain.com/new.

domain.com/folder1 go to -> domain.com/folder1.

sub1.domain.com go to -> sub1.domain.com.

Source: Windows Questions

LEAVE A COMMENT