Solved

Rerouting directories in Apache2

Posted on 2007-04-04
2
189 Views
Last Modified: 2012-05-05
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: http://my.website.com/coolstuff/uploads
New path: http://my.website.com/uploads/coolstuff

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?

0
Comment
Question by:Chisel
2 Comments
 
LVL 11

Accepted Solution

by:
JamesCssl earned 125 total points
ID: 18851258
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.
0
 

Author Comment

by:Chisel
ID: 18852460
Thankyou, that works perfectly =D
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question