Rerouting directories in Apache2

I have recently changed the paths around on my web server and want to make the old paths automatically point to the new paths.

For example:

Old path:
New path:

I'm using Apache2, and want to avoid having to keep the old folders around since I moved them in the first place to mak everything a bit tidier. Any idead how I can achieve what I want easily?

Who is Participating?
JamesCsslConnect With a Mentor Commented:
In your .htaccess file in the root of you site, you can add the following lines:

RewriteEngine On
RewriteRule ^/?coolstuff/uploads(.*)$ /uploads/coolstuff$1 [R=301]

You could alternatively add them to your httpd.conf file if you wanted.
ChiselAuthor Commented:
Thankyou, that works perfectly =D
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.