Post by Percythecat » Tue Mar 09, 2021 1:15 am

Hi there I am going mad here I am trying to get all queries to my website http://www.aladinhiscave.com, http://aladininhiscave.com, https://www.aladinhiscave.com to point to https://aladininhiscave.com

I have tried to change the htaccess files but to no success

This is my current htaccess file

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

Any help please!!

Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by paulfeakins » Tue Mar 09, 2021 7:16 pm


For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by Percythecat » Wed Mar 10, 2021 6:22 pm

Hi thanks for the help but the site only seems to work on https://aladinhiscave.com
If the www is there the icons are missing
So therefore I want all queries to point to the non www https
Any idea thanks

Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by pprmkr » Wed Mar 10, 2021 6:42 pm

Edit .htaccess
After:

Code: Select all

RewriteEngine On
Add:

Code: Select all

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

RewriteCond %{HTTPS} Off [NC]
RewriteRule (.*) https://%{HTTP_HOST}/$1 [L,R=301]

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by Percythecat » Wed Mar 10, 2021 7:18 pm

Hi pprmkr I have tried this and nothings happening, can't see what I am doing wrong, any idea please

Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by pprmkr » Wed Mar 10, 2021 7:35 pm

Check if .txt is removed from default .htaccess.txt and it starts with .
When .htaccess is in use, SEO url's are working as well.

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by mikeinterserv » Wed Mar 10, 2021 9:23 pm

This will direct all to https NON www

Code: Select all

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

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by Percythecat » Wed Mar 10, 2021 10:04 pm

Tried the above but still nothing working, what am I doing wrong any ideas please

Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by mikeinterserv » Wed Mar 10, 2021 10:05 pm

Something

Post your htaccess file here so we can see it
You did change yourdomain.com to well your domain ?

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by mikeinterserv » Wed Mar 10, 2021 10:10 pm

Try this htaccess file

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 +SymLinksIfOwnerMatch
#Options +FollowSymlinks

# Prevent Directory 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
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) https://aladininhiscave.com%{REQUEST_URI} [R=301,L]
# 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 

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by Percythecat » Wed Mar 10, 2021 10:14 pm

The seo urls aren't working either I get a 404 if I try to use them otherwise I get index.php

Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by Percythecat » Wed Mar 10, 2021 10:27 pm

Laughing at Mikes
Something!! Obviously I changed it to my own domain!

Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by mikeinterserv » Wed Mar 10, 2021 10:29 pm

What is your server setup
are you on a VPS - shared hosting - dedicated server ?
It should work regardless unless you have some hosting setup somehow preventing it

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by Percythecat » Wed Mar 10, 2021 10:33 pm

Tried the above htaccess file still the same

Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by Percythecat » Wed Mar 10, 2021 10:38 pm

I am on shared hosting, got to be something there, think I have battered it's head!

Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by mikeinterserv » Wed Mar 10, 2021 10:46 pm

Shared hosting should be fine.
Did you upload the whole htaccess file I posted
You are on a linux server are you with apache

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by Percythecat » Wed Mar 10, 2021 10:54 pm

I replaced the whole file, and yes it's apache, could it be anything to do with the folder
Path?

Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by Percythecat » Wed Mar 10, 2021 10:57 pm

A screenshot

Attachments

Screenshot_2021-03-10-14-55-17.png

Screenshot_2021-03-10-14-55-17.png (121.81 KiB) Viewed 223 times


Newbie

Posts

Joined
Mon Nov 09, 2020 9:13 pm

Post by mikeinterserv » Wed Mar 10, 2021 11:03 pm

That screenshot looks like you domain in not the root directory its in a subdirectory of root

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by mikeinterserv » Wed Mar 10, 2021 11:09 pm

So try this the rewrite base is set to your folder

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 +SymLinksIfOwnerMatch
#Options +FollowSymlinks

# Prevent Directory 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
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) https://aladininhiscave.com%{REQUEST_URI} [R=301,L]
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /aladinhiscave.com/
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 

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales
Who is online

Users browsing this forum: No registered users and 37 guests