views:

19

answers:

1

We serve our content via ourdomain.com/folder.

The next iteration of the application is ready to be rolled out in ourdomain.com/folder2.

If a user tried to access ourdomain.com/folder2 directly he would get a 404.

I need a to get a rewrite rule that serves the content of ourdomain.com/folder2 under the url ourdomain.com/folder and gives the 404 for direct access to ourdomain.com/folder2.

+1  A: 

Why bother with mod_rewrite? Can't you just rename the subdirs?

mv folder folder.old
mv folder2 folder
Alex Howansky
Good thinking, but the all the php files in the folder2 points to the same system in the the templates directory, templates/folder2.Then I would have to edit every single php file.And once we have version 3 going, the renaming process would have to take place again.Doing the rewrite is less time consuming once it has been implemented, then I just need to change one character for every version iteration.
pigfox
Heh ok, well take this opportunity to learn a valuable lesson: use relative paths. :) Or, at the very least, store the path in a variable so that it only needs to be changed in one place.
Alex Howansky
Also, you can symlink folder2 to folder after you rename it -- no editing required.
Alex Howansky
Symlinking might do the job. Thank you!
pigfox