Programming laid out on a platter

Main menu

Tag Archives: 301 redirect

This Excel/VBA program takes a column list of urls where every odd numbered row is the original url and the next even row below it is the url that represents the redirected URL and writes an .htaccess statement for redirects. This is helpful if you do not wish to manually write hundreds of redirects. What this will do is take your large list in column A, put the original url’s in Column C, the redirect url’s in Column D, and your .htaccess 301 redirect statement in Column E:

Option ExplicitPrivate i As Integer‘ Represents the current row we are evaluation in Column APrivate j As Integer‘ Represents the current row for pasting in Column C,D, and E Private ht_stmt As String‘ Represents the current row we are evaluation in Column A Private Const stacked_rows = 2 ‘ Number of Rows that are stacked, in this case, 2, for both original url and new url