Creek
Creek

Reputation: 1

Redirect specific url to another folder in htaccess

I have two directories in my hosting: DIR1 and DIR2.

In the htaccess file I have redirected domain.com on DIR1.

RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]

RewriteCond %{REQUEST_FILENAME} !/DIR1/

RewriteRule ^(.)$ /DIR1/$1 [L]

My problem:

I have a specific url: domain.com/aaa/bbb/files

I want to display content from DIR2 after opening this address

Upvotes: 0

Views: 1066

Answers (1)

Ben
Ben

Reputation: 5129

Add a RewriteRule only for that file:

RewriteRule ^(aaa/bbb/files)$ /DIR2/$1 [L]

Upvotes: 0

Related Questions