Post by graze » Sun May 19, 2019 12:15 am

I'm running on 3.0.2.0 I have an SSL cert but half my site is secure but some pages are not, If I try to for it to HTTPS I just get errors, I can only presume its conficting with something in the file already.

I'm adding this snippet under the first RewriteEngine On

Code: Select all

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

But if I add this to my exsisting file I just get an error here is my exsisting htaccess file

Code: Select all

# STARTNITRO
Header unset ETag
Header unset Last-Modified
FileETag None

#CSS JS XML TXT - 1 MONTH
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>

#JPG JPEG PNG GIF SWF SVG - 1 MONTH
<FilesMatch "\.(jpg|jpeg|png|gif|swf|svg|JPG|JPEG|PNG|GIF|SWF|SVG)$">
Header set Cache-Control "max-age=2592000, public"
ExpiresDefault "access plus 1 month"
Header set Last-Modified "Wed, 05 Jun 2009 06:40:46 GMT"
</FilesMatch>

#OTF WOFF TTF ICO PDF FLV - 1 MONTH
<FilesMatch "\.(otf|ico|pdf|flv|woff|ttf)$">
Header set Cache-Control "max-age=2592000, public"
ExpiresDefault "access plus 1 month"
</FilesMatch>

AddType image/svg+xml .svg
AddOutputFilterByType DEFLATE image/svg+xml
AddType application/x-font-woff .woff
AddOutputFilterByType DEFLATE application/x-font-woff
RewriteEngine On

RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(\/?(catalog.*\/assets).+)\.css$ catalog/view/theme/assets//serveFile.php?t=css&l=4&p=$1&c=2592000 [NC,L]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(\/?(catalog.*\/assets).+)\.js$ catalog/view/theme/assets//serveFile.php?t=js&l=4&p=$1&c=2592000 [NC,L]


# ENDNITRO
# 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 /
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
AuthName "UNDER MAINTENANCE"
AuthUserFile "/home/rclife27/.htpasswds/public_html/passwd"
AddHandler application/x-httpd-php70 .php .php5 .php4 .php3

<Files 403.shtml>
order allow,deny
allow from all
</Files>
I am completly out of my depth and any help would be appricated.

Thanks.

New member

Posts

Joined
Wed Jun 24, 2015 5:28 pm

Post by letxobnav » Sun May 19, 2019 7:11 am

Code: Select all

RewriteEngine on

RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !.*\.(ico|txt|cur|mp3|mpeg|webp|svg|ttf|eot|woff|woff2|gif|jpg|JPG|jpeg|JPEG|png)
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=301,L]

Crystal Light Centrum Taiwan


Active Member

Posts

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

Users browsing this forum: No registered users and 9 guests