Hi, I am currently switching scripts on a directory that I own and want your advice on the best way to redirect the old pages to the corresponding new (or just to the main index might do if nothing else) There are about 2,500 existing .html pages to redirect to about the same number of .php pages. There are only a few inner pages that have links to them and I probably would not bother about a redirect at all but for the fact that google takes so long to drop old cache pages and replace with new. Hope someone can advise. Thanks. Jez.
If your files that were in directory1 are in directory2, put this in directory1's .htaccess RewriteEngine on RewriteRule ^(.*)$ /directory2/$1 [R,L] That will show a redirect. To have a silent redirect, remove the "R" in brackets
Thanks for your reply garbageman. Let me just clarify how the files are atm The site is running on the old script which generates .html pages in the public_html folder. I have set up another script to run alongside it (just to get it working and looking right) in a sub folder of public_html called wsn. I think that's what you said but i just wanted to check with you before I possibly make a terrible mistake if I have misunderstood you I appreciate your help. Jez.
To redirect file(s) /* to /wsn/* without creating an infinite loop, use this as the .htaccess. (As long as the folder /wsn/wsn doesn't exist) RewriteEngine on RewriteRule ^([^w][^s][^n].*)$ /wsn/$1 [R,NC,L] Code (markup):