JWM
09-26-2001, 05:29 PM
I just got this to work, and I was so pleased with myself that just had to post this :D
I replaced a flat file link directory program that generated subdirectories and html files with a MySQL/PHP script.
I wanted to make sure that anyone who tried to access any of the various (99) subdirectories under the old directory were redirected to the new directory.
old directory = /dcd
new directory = /links
redirect /dcd http://www.myurl.com/links
worked, sort of. The problem was the sub-directories. If someone tried to access myurl.com/dcd/subdirectory the above would redirect them to http://www.myurl.com/links/subdirectory which , of course, didn't exist. :waa:
I didn't want to mess around with changing 99 files, or adding 99 .htaccess files, so I search around until I found a reference on the FQ forums to RedirectMatch
Now, I'm using this in my root directory's .htaccess file:
RedirectMatch permanent /dcd/* http://www.myurl.com/links
and all's right with the world :P
No rocket science here, and I'm sure it's all old hat to most of you, but I'm pleased as hell with myself about it. 8}
I replaced a flat file link directory program that generated subdirectories and html files with a MySQL/PHP script.
I wanted to make sure that anyone who tried to access any of the various (99) subdirectories under the old directory were redirected to the new directory.
old directory = /dcd
new directory = /links
redirect /dcd http://www.myurl.com/links
worked, sort of. The problem was the sub-directories. If someone tried to access myurl.com/dcd/subdirectory the above would redirect them to http://www.myurl.com/links/subdirectory which , of course, didn't exist. :waa:
I didn't want to mess around with changing 99 files, or adding 99 .htaccess files, so I search around until I found a reference on the FQ forums to RedirectMatch
Now, I'm using this in my root directory's .htaccess file:
RedirectMatch permanent /dcd/* http://www.myurl.com/links
and all's right with the world :P
No rocket science here, and I'm sure it's all old hat to most of you, but I'm pleased as hell with myself about it. 8}