Post by nortski » Thu Sep 20, 2018 7:44 pm

Hi guys,
My admin login screen has suddenly stopped working for no apparent reason. When I enter my username and password and click login, the screen just refreshes. I do not receive any errors. I am using using OC 2.0.3.1, it has been working fine up until today.
Any ideas?

The Alt Box, built using Opencart 2.0.3.1.


New member

Posts

Joined
Tue Nov 01, 2011 9:22 pm

Post by nortski » Thu Sep 20, 2018 8:25 pm

So it appears to be something to do with my 301 redirects in my .htaccess file:

Code: Select all

Options +FollowSymlinks 
RewriteEngine on 
RewriteBase /

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{QUERY_STRING} ^route=product/special$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ https://%{HTTP_HOST}/gothic-jewellery-sale? [R=301,L]

RewriteCond %{THE_REQUEST} ^.*/index.php 
RewriteRule ^(.*)index.php$ https://www.thealtbox.co.uk/$1 [R=301,L] 
If I comment out the last two lines, these redirect the index.php to the domain root, it solves the login problem.
This is a problem as I need to redirect all versions of the homepage to the domain root.

The Alt Box, built using Opencart 2.0.3.1.


New member

Posts

Joined
Tue Nov 01, 2011 9:22 pm

Post by kestas » Thu Sep 20, 2018 8:37 pm

Have you tried to clear browser cache and cookies, instead of editing .htaccess?

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by IP_CAM » Thu Sep 20, 2018 9:19 pm

try to place the Code like this in the .htaccess file.
Ernie

Code: Select all

Options +FollowSymlinks 
RewriteEngine on 
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{QUERY_STRING} ^route=product/special$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ https://%{HTTP_HOST}/gothic-jewellery-sale? [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index.php 
RewriteRule ^(.*)index.php$ https://www.thealtbox.co.uk/$1 [R=301,L] 
RewriteBase /

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 221 guests