Post by easypeasyac » Fri Oct 04, 2024 12:36 pm

My OpenCart Version : 3.0.4.0
My Apache Version is 2.4.62

Original .htaccess file was that:

Code: Select all

# 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>
I change this lines as:

Code: Select all

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.twig|\.ini|\.log))">
 Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>
Now when i upload original .htaccess, I get an error like that on my homepage and on my all pages except robots.txt files. I can only reach robots.txt file.

Code: Select all

403
Forbidden
Access to this resource on the server is denied!
Last edited by easypeasyac on Sun Oct 06, 2024 5:57 pm, edited 3 times in total.

Newbie

Posts

Joined
Thu Aug 22, 2024 2:51 am

Post by softmonke » Fri Oct 04, 2024 5:56 pm

easypeasyac wrote:
Fri Oct 04, 2024 12:36 pm
OpenCart Version : 3.0.4.0

Original .htaccess file was that:

Code: Select all

# 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>
I change this lines as:

Code: Select all

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.twig|\.ini|\.log))">
 Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>]
Now when i upload original .htaccess, I get an error like that on my homepage and on my all pages except robots.txt files. I can only reach robots.txt file.

Code: Select all

403
Forbidden
Access to this resource on the server is denied!
My apache version is Apache Version 2.4.62
Not sure if it's just a formatting issue when you wrote the post, but there is a "]" character after "</FilesMatch>" in your new htaccess file.

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by easypeasyac » Fri Oct 04, 2024 6:17 pm

softmonke wrote:
Fri Oct 04, 2024 5:56 pm
Not sure if it's just a formatting issue when you wrote the post, but there is a "]" character after "</FilesMatch>" in your new htaccess file.
Hello, yes it is just typo. I just corrected it.

Do you have any idea? ::)

Newbie

Posts

Joined
Thu Aug 22, 2024 2:51 am

Post by nonnedelectari » Fri Oct 04, 2024 8:09 pm

easypeasyac wrote:
Fri Oct 04, 2024 6:17 pm
softmonke wrote:
Fri Oct 04, 2024 5:56 pm
Not sure if it's just a formatting issue when you wrote the post, but there is a "]" character after "</FilesMatch>" in your new htaccess file.
Hello, yes it is just typo. I just corrected it.

Do you have any idea? ::)
Double check what you uploaded and where.

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by easypeasyac » Fri Oct 04, 2024 8:13 pm

Hello;
I checked and try to upload many times and upload it to root directory.
nonnedelectari wrote:
Fri Oct 04, 2024 8:09 pm
Double check what you uploaded and where.

Newbie

Posts

Joined
Thu Aug 22, 2024 2:51 am

Post by JNeuhoff » Fri Oct 04, 2024 9:10 pm

Do you have a valid robots.txt file on your server?

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by nonnedelectari » Fri Oct 04, 2024 10:40 pm

easypeasyac wrote:
Fri Oct 04, 2024 8:13 pm
Hello;
I checked and try to upload many times and upload it to root directory.
nonnedelectari wrote:
Fri Oct 04, 2024 8:09 pm
Double check what you uploaded and where.
That is your complete htaccess?
Did the original ever work?
filematch wise it looks ok, maybe it is in another part of htaccess or your server config?

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by softmonke » Sun Oct 06, 2024 7:43 am

Yea, as @nonnedelectari mentioned, you should probably provide the full original and new .htaccess file. Also, you could try disabling the .htaccess file (i.e. by renaming it to something else like .htaccess.txt) and see if you are still able to access the site? This is just to confirm that it is indeed your .htaccess that is causing the 403 errors.

If disabling the .htaccess file still results in a 403 error, then it's probably not your .htaccess that is causing the issue and you might want to check your file permissions instead.

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by easypeasyac » Sun Oct 06, 2024 6:00 pm

Hello friends;
Sorry i checked all of my .htaccess and found an extra comma and bracket. I deleted it, it works.
I'm sorry I wasn't paying attention, I took up your time.

Newbie

Posts

Joined
Thu Aug 22, 2024 2:51 am
Who is online

Users browsing this forum: No registered users and 22 guests