Chud37
Chud37

Reputation: 5027

Redirect from one directory to another

On our old site, we had a folder called /images/daily with several images inside it.

Now we have redone our site, and the folder is called '/img/daytime' with the same images inside it.

How can I set up my .htaccess file to redirect all requests to /images/daily to the new folder?

Upvotes: 1

Views: 37

Answers (1)

anubhava
anubhava

Reputation: 786349

Put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteRule ^images/daily/(.+)$ /img/daytime/$1 [L,NC,NE,R=301]

Upvotes: 1

Related Questions