Post by stq137 » Sat Aug 29, 2020 2:49 am

Hello all and good day,

My Problem is when i select some categories in my store i got this "The page you requested cannot be found!", this happened on the english page, but if i changed the language to the arabic every thing works just fine, see the following links:
English page : https://www.dealatco.com/Stationery/Fil ... re-holders
Arabic page: https://www.dealatco.com/قرطاسية/أرشفة- ... يبات-حاملة

I'm on OC 3.0.3.2, this problem shows up after i asked to upgrade my hosting plan to a faster speed, and i used A2 optimized plugin in my c panel and noticed that .htaccess file had changed with some A2 code.

Code: Select all

# START A2 LiteSpeed Cache for Dealatco
# Type: OpenCart
<IfModule LiteSpeed>
    CacheEnable public
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} ^GET|HEAD|PURGE$
    RewriteCond %{HTTP_HOST} dealatco.com [NC]
    RewriteCond %{REQUEST_URI} !admin|account|checkout|cart [NC]
    RewriteCond %{HTTP_COOKIE} !logged_in|cust_logged_in|cart|compare|wishlist [NC]
    RewriteCond %{QUERY_STRING} !nocache [NC]
    RewriteRule .* - [E=Cache-Control:max-age=900]
</IfModule>
# END A2 LiteSpeed Cache for Dealatco
<ifModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/pdf "access plus 1 week"
ExpiresByType text/x-javascript "access plus 1 week"
ExpiresByType application/x-shockwave-flash "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresDefault "access plus 1 week"
</ifModule>
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</ifModule>


# 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|.twig|\.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 //
#Force (http host) non www to www (optional)
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#Force (https host) non www to www (optional)
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) 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]

### 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
I have tried to replace the OC installation files with the originals but i got nothing!!

so any ideas??

Newbie

Posts

Joined
Sun Mar 15, 2020 1:23 am

Post by IP_CAM » Sat Aug 29, 2020 2:59 am

.htaccess:
if your shop run's in the Site ROOT, use:
RewriteBase /
if your shop run's in a Site Subdirectory, use:
RewriteBase /shopsubname/
but don't use:
RewriteBase //
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by stq137 » Sat Aug 29, 2020 3:22 am

IP_CAM wrote:
Sat Aug 29, 2020 2:59 am
.htaccess:
if your shop run's in the Site ROOT, use:
RewriteBase /
if your shop run's in a Site Subdirectory, use:
RewriteBase /shopsubname/
but don't use:
RewriteBase //
Ernie
my shop runs on "public_html" directory so i modify to RewriteBase /, but i still have the same issue!

Newbie

Posts

Joined
Sun Mar 15, 2020 1:23 am

Post by IP_CAM » Sat Aug 29, 2020 6:05 am

Check in the Server Error Logs, where it tries to link to, and post the
error message here.

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by stq137 » Sat Aug 29, 2020 6:43 am

This error from admin panel-error log:
2020-08-28 17:26:55 - PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/dealatco/public_html/system/library/template/Twig/Node/Module.php on line 346

This error from c panel-web server errors:
2020-08-28 21:16:53.785429 [INFO] [158767] [91.186.250.234:13504:HTTP2-15#APVH_dealatco.com:443] File not found [/home/dealatco/public_html/404.shtml]

Newbie

Posts

Joined
Sun Mar 15, 2020 1:23 am

Post by IP_CAM » Sat Aug 29, 2020 6:58 am

Sorry, I meant the Visitor Access log, to find out, what link was called. Anyway,
that's a PHP-7-related Problem you have, you will find some answers on this here:
https://www.google.com/search?q=OpenCar ... 8&oe=utf-8

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by letxobnav » Sat Aug 29, 2020 7:23 am

don't use reserved characters like & in your urls.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by stq137 » Sat Aug 29, 2020 10:19 am

letxobnav wrote:
Sat Aug 29, 2020 7:23 am
don't use reserved characters like & in your urls.
This is the answer, finally every thing works fine again, the weird thing is every thing was working just fine before updating the host, another weird thing is there is some other categories with "&" in their url's and they works just fine!!

thank you all guys for your responses. :)

Newbie

Posts

Joined
Sun Mar 15, 2020 1:23 am

Post by letxobnav » Sat Aug 29, 2020 3:32 pm

another weird thing is there is some other categories with "&" in their url's and they works just fine!!
In the link name maybe, not in the seo url, if you want to use & in the url (and why would you) you have to url encode the keywords.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: JessiesBoutique, pprmkr and 498 guests