Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Redirecting old urls via php script


g1smd - 9:50 am on Oct 11, 2012 (gmt 0)


That's the one.

In that script "$statusCode" is set to "301", "404", or "410", or anything else that's valid, as each of those types is logged in separate files.

Additionally, for 301 logging, "$pageType" was set to "category", "product" or "review" when the "$statusCode" was "301" as I was logging the redirects for each of those different page types to separate log files. The calling PHP script also set "$newLocation" so that the logging would show where the user was redirected to.

The "$statusCode" and "$pageType" variables are set by the calling PHP script just before the logging "include". The log file name includes those elements as well as the year and week number for weekly log rotation.

The logger script also detects whether the request is for www., test., or dev. and logs each separately. Adjust the internal file paths to suit your server.


Thread source:: http://www.webmasterworld.com/apache/4506675.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com