Forum Moderators: phranque
I am new to apache and I'd like to upload a .htaccess file.
I have around 50000 static html files that I'd like to redirect - the files are as follows:
www.example.com/Bero.html
www.example.com/Acrobat.html
www.example.com/Brak.html
www.example.com/Cengeritonex.html
www.example.com/WRCCane.html
I moved the files and the structure is now as follows:
www.example.com/A/Aero.html
www.example.com/A/Acrobat.html
www.example.com/B/Brak.html
www.example.com/C/Cengeritonex.html
www.example.com/W/WRCCane.html
Would someone be able to help me and provide guidance regarding how this can be accomplished.
Best,
Ira
RewriteRule ^(([A-Z])[^.]*\.html)$ /$2/$1 [L]
Options +FollowSymLinks
RewriteEngine on
Notice that using this rule requires that *all* .html files be moved into alphabetic subdirectories. If you need to add exceptions to this, then let us know.
Jim