Yii Log Full Og 404 Errors

Hi everyone,

I have a hard time keeping my logs tidy. It is basically full of 404 CHttpExceptions traces. A lot of it is requests of files (mostly images) that are not present at my installation, nor do I link to them anywhere.

I thought that changing the .htaccess file would do the trick:

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php

I have this at the ending with lots of rewrite rules before.

Any tips on solving this?


Are those requests for robots.txt or favicon.ico? If so just make sure you have those available.

If they are different images, add an example, we may be able to help.

Hey and thanks for your interest!

Yes, alot of them are for the favicon.ico which I have as favicon.png, but i made a rewrite rule for that one. And hoping this will fix that.

None for robots.txt which is also present, but for url’s like:




None which I recognize as "valid" for my site.


Does the site replace another that was on the same domain?

If the urls don’t look right, perhaps they are remnants from the old site or in the case of images, could be in some old css classes that are now conflicting??

You might see the old urls if for example, someone views a page from Google’s cache.

Ah, yes this is a clean / new installation of an old domain.

I have been running it for a couple of weeks now, and reindexed through webmaster tool kit. Do you know how long these old files will be requested, or if there is anything I can do to force google to flush the old information?

PS: all css is new



I replaced a site back in August and the old links still appear in Webmaster tools.

They say over time they will disappear but I’m still waiting lol. Good luck with that.


Actually I lied… I last looked at Webmaster about 3 weeks ago, checked again now and the links are gone, wow!

I’m glad about that because the old site must have had some weird loop in the paging that displayed a list of products and there were over 20,000 links that went to the same 100 products.

Thanks for the help!

Too bad webmaster tools do not have a way to flush what they serve right away. I will just have to live with the flooded log then :mellow:

If there is a common format to most of the urls in the log, you could put a rule in htaccess to 301 redirect to an existing page that would be most suitable as a replacement.

Yeah, I can try that, though most of the requests are for images.

Actually here’s a way to speed up the process of removing what is cached by Google: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=164734

It can be done through google webmaster. I think it takes a bit of time.


Yes I was aware of that. Thing is, when you have incoming links from other sites, which helps SEO, you don’t want to lose those links. Much better to 301 if that is the case.

Might be a good idea to try and track where those links are coming from.