Post by one2012 » Sat Jan 04, 2020 9:46 pm

Hello TB support team! Happy New Year!

I have problem with pagination after moving site to another hosting server with CPanel. As I see, trouble with wildcards in URL "?page=" if SEF is active. I click on URL http://domain.com/category1/category2?page=2 and wildcard ?page=2 is removing from URL. If I turn off using SEF, pagination work corectly.

Where can be problem? In server (CPanel) configuration?

New member

Posts

Joined
Wed Feb 06, 2013 11:22 pm

Post by straightlight » Sat Jan 04, 2020 10:57 pm

The issue can originate either from your config.php, admin/config.php files or from your .htaccess file.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by one2012 » Sat Jan 04, 2020 11:18 pm

straightlight wrote:
Sat Jan 04, 2020 10:57 pm
The issue can originate either from your config.php, admin/config.php files or from your .htaccess file.
Can you point me where?

New member

Posts

Joined
Wed Feb 06, 2013 11:22 pm

Post by straightlight » Sun Jan 05, 2020 2:51 am

You'd need to post your .htaccess as well as your config.php and admin/config.php files (without server path and password information).

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by one2012 » Mon Jan 06, 2020 2:56 pm

Hello, here is my files but I can't understand, why on old hostiong pagination work and on new no. :-\
.htaccess file
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
# 2. In your opencart directory rename htaccess.txt to .htaccess.
# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{THE_REQUEST} \ /index\.php\?_route_=?([^&\ ]*)
RewriteRule ^ /%1? [L,R]


RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200

# 7. disable open_basedir limitations
# php_admin_value open_basedir none

# Compressing output
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</Ifmodule>

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers

# Defining MIME types to ensure the web server actually knows about them.
<IfModule mod_mime.c>
AddType application/javascript js
AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf ttf ttc
AddType font/opentype otf
AddType application/x-font-woff woff
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
</Ifmodule>
main config.php file
<?php
// HTTP
define('HTTP_SERVER', 'http://www.domain.com/');

// HTTPS
define('HTTPS_SERVER', 'https://www.domain.com/');

// DIR
define('DIR_APPLICATION', '/home3/domain.com/public_html/catalog/');
define('DIR_SYSTEM', '/home3/domain.com/public_html/system/');
define('DIR_IMAGE', '/home3/domain.com/public_html/image/');
define('DIR_LANGUAGE', '/home3/domain.com/public_html/catalog/language/');
define('DIR_TEMPLATE', '/home3/domain.com/public_html/catalog/view/theme/');
define('DIR_CONFIG', '/home3/domain.com/public_html/system/config/');
define('DIR_CACHE', '/home3/domain.com/public_html/system/storage/cache/');
define('DIR_DOWNLOAD', '/home3/domain.com/public_html/system/storage/download/');
define('DIR_LOGS', '/home3/domain.com/public_html/system/storage/logs/');
define('DIR_MODIFICATION', '/home3/domain.com/public_html/system/storage/modification/');
define('DIR_UPLOAD', '/home3/domain.com/public_html/system/storage/upload/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'domain.com_main');
define('DB_PASSWORD', 'pass;
define('DB_DATABASE', 'domain.com_main');
define('DB_PORT', '3306');
define('DB_PREFIX', 'xxxx_');

admin config.php file
<?php
// HTTP
define('HTTP_SERVER', 'http://www.domain.com/admin/');
define('HTTP_CATALOG', 'http://www.domain.com/');

// HTTPS
define('HTTPS_SERVER', 'https://www.domain.com/admin/');
define('HTTPS_CATALOG', 'https://www.domain.com/');

// DIR
define('DIR_APPLICATION', '/home3/domain.com/public_html/admin/');
define('DIR_SYSTEM', '/home3/domain.com/public_html/system/');
define('DIR_IMAGE', '/home3/domain.com/public_html/image/');
define('DIR_LANGUAGE', '/home3/domain.com/public_html/admin/language/');
define('DIR_TEMPLATE', '/home3/domain.com/public_html/admin/view/template/');
define('DIR_CONFIG', '/home3/domain.com/public_html/system/config/');
define('DIR_CACHE', '/home3/domain.com/public_html/system/storage/cache/');
define('DIR_DOWNLOAD', '/home3/domain.com/public_html/system/storage/download/');
define('DIR_LOGS', '/home3/domain.com/public_html/system/storage/logs/');
define('DIR_MODIFICATION', '/home3/domain.com/public_html/system/storage/modification/');
define('DIR_UPLOAD', '/home3/domain.com/public_html/system/storage/upload/');
define('DIR_CATALOG', '/home3/domain.com/public_html/catalog/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'domain.com_main');
define('DB_PASSWORD', 'pass;
define('DB_DATABASE', 'domain.com_main');
define('DB_PORT', '3306');
define('DB_PREFIX', 'xxxx_');

New member

Posts

Joined
Wed Feb 06, 2013 11:22 pm

Post by xxvirusxx » Tue Jan 07, 2020 1:26 am

Main config

From

Code: Select all

// HTTP
define('HTTP_SERVER', 'http://www.domain.com/');

// HTTPS
define('HTTPS_SERVER', 'https://www.domain.com/');
To

Code: Select all

// HTTP
define('HTTP_SERVER', 'https://www.domain.com/');

// HTTPS
define('HTTPS_SERVER', 'https://www.domain.com/');
Admin config

From

Code: Select all

// HTTP
define('HTTP_SERVER', 'http://www.domain.com/admin/');
define('HTTP_CATALOG', 'http://www.domain.com/');

// HTTPS
define('HTTPS_SERVER', 'https://www.domain.com/admin/');
define('HTTPS_CATALOG', 'https://www.domain.com/');
To

Code: Select all

// HTTP
define('HTTP_SERVER', 'https://www.domain.com/admin/');
define('HTTP_CATALOG', 'https://www.domain.com/');

// HTTPS
define('HTTPS_SERVER', 'https://www.domain.com/admin/');
define('HTTPS_CATALOG', 'https://www.domain.com/');
In .htaccess comment this lines and test

From:

Code: Select all

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
To:

Code: Select all

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Opencart 2.3.0.2 Bugs fix added |Opencart 3.0.3.1 Bugs fix added | My converted modules


User avatar
Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - RO

Post by one2012 » Tue Jan 07, 2020 4:38 pm

Comenting out lines in .htaccess solve problem but I can't understand why it call problem.

New member

Posts

Joined
Wed Feb 06, 2013 11:22 pm

Post by xxvirusxx » Wed Jan 08, 2020 4:32 am

Content from .htaccess not work the same on all servers...

Opencart 2.3.0.2 Bugs fix added |Opencart 3.0.3.1 Bugs fix added | My converted modules


User avatar
Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - RO
Who is online

Users browsing this forum: No registered users and 5 guests