Author Topic: non-configured warning  (Read 3423 times)

Offline jetman

  • Newbie
  • *
  • Posts: 17
  • Karma: +3/-0
    • View Profile
non-configured warning
« on: January 30, 2017, 04:52:26 AM »
A warning triggered by requesting urls with an specified port number (in this case, port 80) and the configured store url doesn't (this one was caused by a bad bot - must be from the department of redundancy department).

The store url is [http]://www.mydomain.com/ and the request is [http]://www.mydomain.com:80/

This is easily repeatable. Please note that I had to use a http header check tool to trigger the warning myself, modern browsers seem to remove the redundancy before sending the request.

Possible solution is to remove the default port number but still allow non-default port numbers (ex. 8080) before the check on line 168 in /core/lib/config.php

App Warning: AbanteCart core v.1.2.9 Warning: Accessing store with non-configured or unknown domain ( mydomain.com:80/ ).
Check setting of your store domain URL in System Settings . Loading default store configuration for now. in /home/*****/public_html/core/lib/config.php on line 210

php 7.0.13
litespeed
AbanteCart v.1.2.9

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2048
  • Karma: +319/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: non-configured warning
« Reply #1 on: January 30, 2017, 06:00:00 AM »
i think you should to add rewriting for url with port to url without it.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline jetman

  • Newbie
  • *
  • Posts: 17
  • Karma: +3/-0
    • View Profile
Re: non-configured warning
« Reply #2 on: January 30, 2017, 03:56:32 PM »
Thanks abolabo. I changed our .htaccess to the following:

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\. [NC, OR]
RewriteCond %{HTTP_HOST} :80
RewriteRule ^(.*) htp://www.mydomain.com/$1 [L,R=301] (note htp is http)

But I don't think mod_rewrite is an elegant solution since it is more complex for multi-store setups. Every domain would need its own RewriteCond and RewriteRule. php would be the better tool for the job.

 

Powered by SMFPacks Social Login Mod