Σελίδα 1 από 1

htaccess https://

Δημοσιεύτηκε: 11 Οκτ 2019, 10:49
από spyros
Καλημερα σας θα ηθελα την βοηθεια σας ψαχνω τον κωδικα για το htacess εχω κανει install ενα opencart ως https://domain.com και θελω να κανω redirect ολα τα http:// και το https://www στο https:// ευχαριστω εκ των προτερων

Re: htaccess https://

Δημοσιεύτηκε: 11 Οκτ 2019, 11:43
από botonakis
Η λύση σε αυτό που ψάχνεις υπάρχει παντού στο ιντερνετ.

Ανοίγεις το αρχείο .htaccess

Βρίσκεις τις γραμμές:
Κώδικας: Επιλογή όλων
RewriteEngine On
RewriteBase /
και τις αντικαθιστάς με το παρακάτω:
Κώδικας: Επιλογή όλων
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.domain.gr%{REQUEST_URI} [R=301,L,NE]
RewriteBase /
Στον παραπάνω κώδικα, αντικαθιστάς το domain.gr με το δικό σου domain name.

Re: htaccess https://

Δημοσιεύτηκε: 11 Οκτ 2019, 12:01
από spyros
https://www.store33.gr κρεμασε δυστηχως ολο ....επισης εγω θελω να ανοιγη ως https://store33.gr

Re: htaccess https://

Δημοσιεύτηκε: 11 Οκτ 2019, 12:09
από botonakis
Κάτι λάθος κάνεις στις αλλαγές του αρχείου. Για να "κρεμάσει" σημαίνει ότι υπάρχει λάθος. Κάνε copy-paste το τωρινό σου htaccess εδώ να δούμε τι έξτρα αλλαγές έχεις.

Όσο για το να κάνει redirect σε όχι www. η αλλαγή είναι η αντίστοιχη:
Κώδικας: Επιλογή όλων
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://domain.gr%{REQUEST_URI} [R=301,L,NE]
RewriteBase /
ΥΣ: Εάν έχεις ήδη άλλο κώδικα που κάνει redirection, είτε σε άλλο αρχείο είτε μέσα στο .htaccess , το πιο πιθανό είναι η σελίδα σου να σταματήσει να λειτουργεί γιατί δημιουργείς infinate redirection loop.

Re: htaccess https://

Δημοσιεύτηκε: 11 Οκτ 2019, 12:20
από spyros
σε ευχαριστω αφανταστα για την βοηθεια εκανα την αλλαγη που ανεφερες αλλα δεν λειτουργει σου στελνω το αρχειο ολο μαζι με την αλλαγη
Κώδικας: Επιλογή όλων
# 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
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://vaporstore.eu%{REQUEST_URI} [R=301,L,NE]
RewriteBase /
# 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]

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

Re: htaccess https://

Δημοσιεύτηκε: 11 Οκτ 2019, 12:23
από botonakis
Μέσα στον κώδικα έχεις 2 φορές το:
Κώδικας: Επιλογή όλων
RewriteBase /
αφαίρεσαι το 2ο.

Re: htaccess https://

Δημοσιεύτηκε: 11 Οκτ 2019, 12:25
από spyros
το αφερεσα αλλα δεν λειτουργει ο κωδικας εχει ως εξης
Κώδικας: Επιλογή όλων
# 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
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://vaporstore.eu%{REQUEST_URI} [R=301,L,NE]
RewriteBase /
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /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]

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

Re: htaccess https://

Δημοσιεύτηκε: 11 Οκτ 2019, 12:28
από botonakis
όπως θα δείς στην εικόνα του site σου:
Screenshot 2019-10-11 at 10.46.11.png
Είναι το πρόβλημα που σου ανέφερα πιο πάνω. Too Many Redirects.
Κάπου λοιπόν έχεις βάλει κώδικα που κάνει redirection σε www. ή σε κάτι άλλο. Συνήθως αυτό το κάνουν κάποια SEO plugins ή καρφωτός κώδικας στο /config.php

Re: htaccess https://

Δημοσιεύτηκε: 11 Οκτ 2019, 12:31
από spyros
μπορειτε να με βοηθησετε σας παρακαλω?