views:

44

answers:

2

I'm rebuilding a site with a lot of incoming links, and the URL structure is completely changing. I'm using the stock mod_rewrite solution to redirect all old links to new pages. However, as I'm sure a few links will slip through the net, I've built a small script that runs on my custom 404 page, to log the incoming visitors' referrer URL. This will help me track down any broken links.

In addition to referrer, is there also a way of logging the url that the user entered, or clicked that caused a 404? I ask this as referrer is obviously a bit 'hit & miss'.

I suspect not, but thought it worth a question.

+1  A: 

You could determine from the logs what happened a short time earlier for that user. The referrer alone may not always put you into the right context.

Tomalak
+1  A: 

You could maintain your old virtual folder structure during a transition period and put redirect pages in place to the new content. If the structure is changing very radically so that is not possible then you basically don't have enough information from the old URL's to direct them.

Simon