Post by Robonz » Wed Dec 13, 2017 9:02 am

I have Opencart Version 2.3.0.2 running on Apache . I am trying to get SEO URLS working
Store is running at https://mendit.co.nz/shop/
Store URL on System/settings is http://mendit.co.nz/shop/

I had to do a custom htaccess due to other requirements, here it is. When I click on a SEO URL product it directs me to
https://mendit.co.nz/shop/pretty_url
and I get a product not found
If I go to https://mendit.co.nz/pretty_url the product is there, What have I done wrong?

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mendit\.co\.nz$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mendit\.co\.nz$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# SEO URL Settings
Options +FollowSymlinks
Options -Indexes
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
Require all denied
</FilesMatch>
# END SEO URL Settings

# SEO URL Settings
RewriteEngine on
RewriteBase /shop/
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]
# END SEO URL Settings

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

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

<IfModule mod_expires.c>

# Enable expirations
ExpiresActive On

# Default directive
ExpiresDefault "access plus 1 month"

# My favicon
ExpiresByType image/x-icon "access plus 1 year”

# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"

# CSS
ExpiresByType text/css "access 1 week”

# Javascript
ExpiresByType application/javascript "access plus 1 year"

</IfModule>

Newbie

Posts

Joined
Mon Feb 27, 2017 2:24 pm

Post by Robonz » Thu Dec 14, 2017 6:43 am

Looks like I am a dumb dumb again. I did not realise I needed to run two htaccess files

1 in the root folder of my website to handle the https and cache etc
2 htaccess in the "shop" folder to support SEO URLS

I burnt some time on this stupid mistake. Back to loving opencart!

Newbie

Posts

Joined
Mon Feb 27, 2017 2:24 pm
Who is online

Users browsing this forum: No registered users and 259 guests