Post by werepair » Sat Nov 19, 2011 2:32 pm

I got some error messages in my error log


2011-11-18 19:47:04 - PHP Notice: Undefined index: HTTP_HOST in /home/xxxxxxx/public_html/index.php on line 179
2011-11-18 19:47:04 - PHP Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxx/public_html/index.php:49) in /home/xxxxxxx/public_html/index.php on line 179
2011-11-18 19:47:04 - PHP Notice: Undefined index: HTTP_HOST in /home/xxxxxxx/public_html/system/library/currency.php on line 45
2011-11-18 19:47:04 - PHP Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxx/public_html/index.php:49) in /home/xxxxxxx/public_html/system/library/currency.php on line 45

i have found this info about HTTP_HOST and daniel states the following

"HTTP_HOST is if you visit your site from an ip. set some redirect in your .htaccess."

what redirect would i put in my htaccess to stop the error ?

Best Regards
Last edited by i2Paq on Sat Nov 19, 2011 3:28 pm, edited 1 time in total.
Reason: Split, renamed

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by i2Paq » Sat Nov 19, 2011 6:26 pm

Used our FREE search on: headers already sent?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by werepair » Sun Nov 20, 2011 12:07 am

i2Paq wrote:Used our FREE search on: headers already sent?
i already have searched for header sent but i am still none the wiser how to stop the errors, there are no white spaces etc.

regards

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by uksitebuilder » Sun Nov 20, 2011 3:22 am

werepair wrote:what redirect would i put in my htaccess to stop the error ?
After the RewriteBase line add the following

Code: Select all

#RewriteCond %{HTTP_HOST} !^www\.yoursite\.com
#RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]

replace www\.yoursite\.com and http://www.yoursite.com with your site's domain

the backslashes are important in the condition line

ImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by werepair » Sun Nov 20, 2011 4:24 am

uksitebuilder wrote:
werepair wrote:what redirect would i put in my htaccess to stop the error ?
After the RewriteBase line add the following

Code: Select all

#RewriteCond %{HTTP_HOST} !^www\.yoursite\.com
#RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]

replace www\.yoursite\.com and http://www.yoursite.com with your site's domain

the backslashes are important in the condition line
Hi Simon,
thanks for that mate, so i need to add the following and change yoursite.com to mydomain.co.uk ..... is there any back slashes seperating the .co.uk ( \.co\.uk)
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by uksitebuilder » Sun Nov 20, 2011 4:58 am

in the condition line, escape any periods with a backslash

www\.abc\.co\.uk etc

ImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by werepair » Sun Nov 20, 2011 4:54 pm

cheers for the fast response again appreciated.
best regards

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by werepair » Mon Nov 21, 2011 2:45 pm

ok i am now getting the following error message.
2011-11-21 5:21:07 - PHP Warning: Division by zero in /home/xxxxxx/public_html/system/library/pagination.php on line 32

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by uksitebuilder » Mon Nov 21, 2011 3:31 pm

That's totally unrelated to this.

What were you doing at the time that error appeared (what page were you on etc) ?

ImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by werepair » Mon Nov 21, 2011 3:42 pm

not sure mate the error was in my log when i logged in this morning
best regards

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by uksitebuilder » Mon Nov 21, 2011 3:56 pm

Very strange, I'm guessing it's a bot of some sorts

Can you check your server error log and get the IP address related to the error

You should then be able to find out who or what it is by doing a whois on the IP

ImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by werepair » Mon Nov 21, 2011 11:55 pm

uksitebuilder wrote:Very strange, I'm guessing it's a bot of some sorts

Can you check your server error log and get the IP address related to the error

You should then be able to find out who or what it is by doing a whois on the IP
hi simon,
thanks for the reply, i have checked the server log and there are no errors listed in the log

Best Regards

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by uksitebuilder » Tue Nov 22, 2011 5:53 pm

Hi,

All I can suggest is you monitor it to see if it occurs regularly or if it was just a one off.

ImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by werepair » Tue Nov 22, 2011 9:47 pm

ok mate thanks for your help again, appreciated
best regards

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by hbg » Tue Jan 31, 2012 10:31 am

I had a similar error. 9 times over 2-3 hours.
ie:
2012-01-30 10:18:42 - PHP Warning: Division by zero in /xxxx/shop/system/library/pagination.php on line 32
2012-01-30 10:29:57 - PHP Warning: Division by zero in /xxxx/shop/system/library/pagination.php on line 32
2012-01-30 10:35:35 - PHP Warning: Division by zero in /xxxx/shop/system/library/pagination.php on line 32
2012-01-30 10:46:52 - PHP Warning: Division by zero in /xxxx/shop/system/library/pagination.php on line 32
2012-01-30 10:52:27 - PHP Warning: Division by zero in /xxxx/shop/system/library/pagination.php on line 32
2012-01-30 10:58:04 - PHP Warning: Division by zero in /xxxx/shop/system/library/pagination.php on line 32
2012-01-30 11:03:41 - PHP Warning: Division by zero in /xxxx/shop/system/library/pagination.php on line 32
2012-01-30 11:48:16 - PHP Warning: Division by zero in /xxxx/shop/system/library/pagination.php on line 32
2012-01-30 12:30:57 - PHP Warning: Division by zero in /xxxx/shop/system/library/pagination.php on line 32

Code: Select all

$num_pages = ceil($total / $limit);
[/i] is the line.

Opencart Version 1.5.1.3
https://www.opencart.homebrewinn.com.au/shop/


User avatar
hbg
Active Member

Posts

Joined
Wed Apr 13, 2011 8:52 am
Location - Newcastle NSW Australia

Post by Demon5 » Wed Feb 22, 2012 3:03 pm

For the record this effectively breaks multi store because it just redirects to one url. The way I posted below will redirect the ip's to main site but if you use multistore blah.com won't go to main.com. The previous way would simply make everything go to the main store.

Code: Select all

RewriteCond %{HTTP_HOST} ^192\.168\.0\.1 [OR]
RewriteCond %{HTTP_HOST} ^192\.168\.0\.2
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
uksitebuilder wrote:
werepair wrote:what redirect would i put in my htaccess to stop the error ?
After the RewriteBase line add the following

Code: Select all

#RewriteCond %{HTTP_HOST} !^www\.yoursite\.com
#RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]

replace www\.yoursite\.com and http://www.yoursite.com with your site's domain

the backslashes are important in the condition line

https://www.lotnllc.com is your one stop shop for all your computer needs!


User avatar
Active Member

Posts

Joined
Sat Jun 19, 2010 4:12 am
Location - Sacramento, CA

Post by hbg » Wed May 09, 2012 3:39 pm

I have just changed the $limit value to 15. Maybe that might work?

Opencart Version 1.5.1.3
https://www.opencart.homebrewinn.com.au/shop/


User avatar
hbg
Active Member

Posts

Joined
Wed Apr 13, 2011 8:52 am
Location - Newcastle NSW Australia

Post by hbg » Thu Oct 18, 2012 6:54 am


Opencart Version 1.5.1.3
https://www.opencart.homebrewinn.com.au/shop/


User avatar
hbg
Active Member

Posts

Joined
Wed Apr 13, 2011 8:52 am
Location - Newcastle NSW Australia
Who is online

Users browsing this forum: No registered users and 5 guests