Post by onoriotorti » Wed Dec 12, 2018 6:31 pm

Hi everyone I need some help hopefully someone can help I will start by saying I'm using opencart 2.2 (yeah I know) with the Journal2 theme and my website is www.cattex.com
As the title states I have an issue when my SEO URLs are activated and when all my pages are HTTPS, they work correctly as long as their counterpart is turned off.
basically right now my site is entirely HTTPS, and all my URLs look like this:
https://www.cattex.com/index.php?route= ... ry&path=17 compared to a nice https://www.cattex.com/unprinted-balloons

when I activate SEO URLs from the admin the site works correctly for up to the category, then it loses CSS for subcategories and products (see attached image)
So Basically:

www.cattex.com => works
www.cattex.com/category => works
www.cattex.com/product => works
www.cattex.com/category /subcategory => broken page (no CSS)
www.cattex.com/category /product => broken page (no CSS)

basically adding the second "/" in the URL sends it nuts.

also if "index.php?route=" is within the SEO URL then it works correctly:

www.cattex.com/index.php?route=category/product => works
www.cattex.com/category/product => broken page (no CSS)

I have read different forums adressing this issue already but all the solutions that were posted did't work for me.
Considering it might be an issue with the way the .htaccess is written I will also post it.

Code: Select all

# 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
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.cattex.com/$1 [R=301,L]
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=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]

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt))">
	 Order deny,allow
	 Deny from all
</FilesMatch>

# Compress text, HTML, JavaScript, CSS, and XML
<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
	
	# Common Fonts
	AddOutputFilterByType DEFLATE image/svg+xml
	AddOutputFilterByType DEFLATE application/x-font-ttf
	AddOutputFilterByType DEFLATE application/font-woff
	AddOutputFilterByType DEFLATE application/font-woff2
	AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
	AddOutputFilterByType DEFLATE application/x-font-otf

	# Remove browser bugs
	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>

# Expires caching
<IfModule mod_expires.c>
	AddType application/vnd.ms-fontobject .eot 
	AddType application/x-font-ttf .ttf
	AddType application/x-font-opentype .otf
	AddType application/x-font-woff .woff
	AddType application/x-font-woff2 .woff2
	AddType image/svg+xml .svg

	ExpiresActive On

	# CSS
	ExpiresByType text/css			        "access plus 1 week"

	# JavaScript
    ExpiresByType application/javascript                "access plus 1 week"

	# Favicon (cannot be renamed!) and cursor images
    ExpiresByType image/x-icon                          "access plus 1 week"

	# Media
	ExpiresByType application/pdf			"access plus 1 week"
	ExpiresByType application/x-shockwave-flash	"access plus 1 week"
	ExpiresByType image/x-win-bitmap		"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"

	# Web fonts
    ExpiresByType application/vnd.ms-fontobject		"access plus 1 month"
	ExpiresByType application/x-font-ttf		"access plus 1 month"
	ExpiresByType application/x-font-opentype	"access plus 1 month"
	ExpiresByType application/x-font-woff		"access plus 1 month"
	ExpiresByType application/x-font-woff2		"access plus 1 month"
	ExpiresByType image/svg+xml			"access plus 1 month"
</IfModule>

# Add accept encoding
<IfModule mod_headers.c>
	<FilesMatch ".(js|css|xml|gz)$">
		Header append Vary: Accept-Encoding
	</FilesMatch>

	# Snippet to fix Font Awesome not loading in some Firefox configurations (http://wpvkp.com/font-awesome-doesnt-display-in-firefox-maxcdn/)
	<FilesMatch ".(ttf|otf|eot|woff)$">
		Header set Access-Control-Allow-Origin "*" 
	</FilesMatch>

	<filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$">
  		Header set Cache-Control "max-age=2678400, public"
  	</filesmatch>

  	<filesmatch "\.(html|htm)$">
  		Header set Cache-Control "max-age=7200, private, must-revalidate"
  	</filesmatch>

  	<filesmatch "\.(pdf)$">
  		Header set Cache-Control "max-age=86400, public"
  	</filesmatch>

  	<filesmatch "\.(js)$">
  		Header set Cache-Control "max-age=2678400, private"
  	</filesmatch>

	Header set Connection keep-alive
</IfModule>


RewriteEngine On

# Block MySQL injections, RFI, base64, etc.
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR]
RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
RewriteCond %{QUERY_STRING} (\.\./|\.\.) [OR]
RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
RewriteCond %{QUERY_STRING} http\: [NC,OR]
RewriteCond %{QUERY_STRING} https\: [NC,OR]
RewriteCond %{QUERY_STRING} \=\|w\| [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)/self/(.*)$ [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)cPath=http://(.*)$ [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^i]*i)+frame.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>).* [NC,OR]
RewriteCond %{QUERY_STRING} (NULL|OUTFILE|LOAD_FILE) [OR]
RewriteCond %{QUERY_STRING} (\./|\../|\.../)+(motd|etc|bin) [NC,OR]
RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR]
RewriteCond %{QUERY_STRING} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
RewriteCond %{QUERY_STRING} concat[^\(]*\( [NC,OR]
RewriteCond %{QUERY_STRING} union([^s]*s)+elect [NC,OR]
RewriteCond %{QUERY_STRING} union([^a]*a)+ll([^s]*s)+elect [NC,OR]
RewriteCond %{QUERY_STRING} (;|<|>|'|"|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|order|script|set|md5|benchmark|encode) [NC,OR]
RewriteCond %{QUERY_STRING} (sp_executesql) [NC]
RewriteRule ^(.*)$ - [F,L]


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

### 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

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php70” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php70 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 384M
   php_value post_max_size 20M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php70"
   php_value upload_max_filesize 10M
   php_flag zlib.output_compression On
</IfModule>
# END cPanel-generated php ini directives, do not edit
hopefully someone can help me with this and I thank in advance all the suggestions that will come out.

Attachments

image.JPG

image.JPG (48.56 KiB) Viewed 633 times


New member

Posts

Joined
Tue Jun 20, 2017 5:36 pm

Post by onoriotorti » Mon Dec 17, 2018 3:37 pm

Does anybody have a solution for this?

New member

Posts

Joined
Tue Jun 20, 2017 5:36 pm

Post by onoriotorti » Thu Dec 20, 2018 5:29 pm

still no answer, must be a tough nut to crack!

New member

Posts

Joined
Tue Jun 20, 2017 5:36 pm

Post by ADD Creative » Fri Dec 21, 2018 2:02 am

You have a lot in your htaccess file. Have you tried just keeping it to the basics (see link below) and with the PHP settings at the bottom?

https://github.com/opencart/opencart/bl ... access.txt

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by onoriotorti » Wed Jan 09, 2019 3:57 pm

ADD Creative wrote:
Fri Dec 21, 2018 2:02 am
You have a lot in your htaccess file. Have you tried just keeping it to the basics (see link below) and with the PHP settings at the bottom?

https://github.com/opencart/opencart/bl ... access.txt
sorry for the late reply and thank you for your answer.
I have tried but the problem is still present.

New member

Posts

Joined
Tue Jun 20, 2017 5:36 pm

Post by ADD Creative » Wed Jan 09, 2019 11:38 pm

I think the next step would be to disable your theme and extensions one by one, to see if any of them are causing the problem. You may want to make a duplicate of your site to do the testing on.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by onoriotorti » Thu Jan 10, 2019 4:08 pm

Ok, I will see if any of the extensions are causing the problem.

New member

Posts

Joined
Tue Jun 20, 2017 5:36 pm

Post by jdlogos » Mon Jan 14, 2019 7:02 pm

I have the exact same issue as described, let me know if you find a solution!

Newbie

Posts

Joined
Wed Sep 24, 2014 6:05 am

Post by JNeuhoff » Mon Jan 14, 2019 8:06 pm

The SEO URLs work just fine on a standard OpenCart 2.x. Hence something else must be responsible for causing problems. It could be an issue with the Journal2 theme because the latter is highly incompatible with OpenCart standards and is known to cause clashes with many 3rd party extensions. To narrow it down, it might be best to disable 3rd party extensions, one by one, including the Journal2 theme, to see whether the problem goes away.

MHC Web Design
Override Engine * Integrated VQMod * Multilingual SEO * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: secure-bay and 18 guests