i was wondering if there is a way to log 301 redirects issued from htaccess, just by using php, no apache modifications (no htaccess rules, no http.conf modifications, no apache logs) just plain php code.
phranque
4:49 pm on Nov 29, 2013 (gmt 0)
no.
lucy24
9:46 pm on Nov 29, 2013 (gmt 0)
On the other hand: If you take all the pages you're currently redirecting, and instead rewrite them to a php page which does the lookup and issues the 301, it should be fairly trivial to log that activity. Where "fairly trivial" = I have no idea how to do it,* but I'm confident that someone hereabouts does.
* I can follow directions at php dot net, but only if I know where to look in the first place.
Readie
6:44 pm on Nov 30, 2013 (gmt 0)
Pretty simple if you use a PHP script as Lucy suggests.
Picky, picky :P But the 301s have to come from somewhere. So if you replace the existing redirects with a rewrite to a different page, it barely counts as a "modification".
That's assuming the redirects originate in htaccess. (OP specifically said they do.) If they are all in-page redirects, it's a whole nother ballgame.
omoutop, do you have access to the config file? If yes, why are you also using htaccess?
omoutop
6:49 am on Dec 2, 2013 (gmt 0)
6 months ago we change out site - new design and new urls so we had around 25000 301 redirects now we change some urls again and old redirects must be replaced with new ones
we need a way to monitor which 301 rules are still active (user bookmarks, bots, anything) and which ones are no longer apply so as to clear out this 301 list
the php file seems good solution - i can move all 301 rules to a table in database and monitor from there.
i will give it a try
lucy24
9:29 am on Dec 2, 2013 (gmt 0)
The day after you remove a no-longer-needed redirect, some major search engine will swing by and request three hundred of your old URLs.
Fact.
omoutop
11:10 am on Dec 2, 2013 (gmt 0)
:)
penders
12:07 am on Dec 3, 2013 (gmt 0)
I know you mentioned "no apache logs", but I'm curious... are your access logs not available?
omoutop
8:36 am on Dec 3, 2013 (gmt 0)
no penders i have no access to any logs, to no conf files only access i got is limited ftp
lucy24
7:25 pm on Dec 3, 2013 (gmt 0)
No logs AT ALL? Sounds like it's time to go host-shopping.