Page 1 of 1
Exception for one folder in .htaccess - possible? (Solved)
Posted: Fri Dec 22, 2017 3:41 pm
by Cleo
Hello,
I was using this .htaccess in the catalog folder:
Code: Select all
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !^(.+)\.jpg$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.JPG$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.jpeg$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.JPEG$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.png$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.PNG$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.gif$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.GIF$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.css$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.js$
RewriteRule ^(.+)$ /circkel/ [NC]
But people cannot use the Make an Offer feature because they are getting the "page not found"
I tried to change the .htaccess with the following content:
Code: Select all
<FilesMatch "\.(php|tpl|txt)$">
Order Deny,Allow
Deny from all
Allow from "my static ip"
</FilesMatch>
And of course it's the same problem.
The files for the Make an offer feature are in the subfolder: /catalog/model/myoffer
I believe I can probably add a .htaccess file in every subfolder except the /myoffer one instead of one in the catalog folder but I was wondering if I could add a rule (and which rule) to the .htaccess file instead to prevent the error when someone try to make an offer?
Thank you
Re: Exception for one folder in .htaccess - possible?
Posted: Sun Dec 24, 2017 12:53 am
by DevmanExtensions
Hi!
If you rename ".htaccess" to ".htaccess_" (with a line in end name) the problem is solved?? maybe is not a problem from .htaccess.
Thanks!
Re: Exception for one folder in .htaccess - possible?
Posted: Mon Dec 25, 2017 10:35 am
by Cleo
Hi,
Thank you for the reply, the problem is: I don't want to disable the .htaccess file, I added it to the catalog folder to prevent access to it, if I do as you suggested the .htaccess will be disable which I don't want.
The files for the extension called "Make an Offer" are in a subfolder in the catalog folder and the .htaccess is preventing access to the catalog folder and all the subfolders so the "Make an Offer" feature/extension cannot be use.
So because I don't want to remove/disable the .htaccess file from the catalog folder because I want to prevent access to it I was wondering if a rule could be add to the .htaccess file that would still prevent access to the folder but would make the use of the feature enable.
So what I need is a just a rule that I can add to the .htaccess file in the catalog folder that would still prevent access to it but make an exception for the "subfolder Make an Offer" so people would be able to use the "Make an Offer" feature.
Maybe I explained it better this time?
Tks
Cleo
Re: Exception for one folder in .htaccess - possible?
Posted: Sun Mar 04, 2018 3:58 pm
by Cleo
Any .htaccess expert?
Tks,
Cleo
Re: Exception for one folder in .htaccess - possible?
Posted: Fri Mar 09, 2018 7:35 pm
by ADD Creative
Have you tried adding to following just before your RewriteRule?
Code: Select all
RewriteCond %{REQUEST_URI} !^/catalog/model/myoffer/.*$
Or you could also try putting a new .htaccess file in the folder you want to ignore with.
However it does not seem right that any assess should be required to catalog/model/myoffer. Any acces should go through index.php?route=. What is being accessed in this directory?
Re: Exception for one folder in .htaccess - possible?
Posted: Sat Mar 10, 2018 10:04 am
by Cleo
Hello ADD Creative and thank you for the reply and suggestion. I will try both of them.
The subfolder contain a file (script) which bring up a pop up form that the customers need to fill with their offer (hope I am explaining it right?) If not you may try it
http://www.lesbricollesdecleo.ca/home-a ... -2010-2011
to see for yourself!
Thank you
Cleo
Re: Exception for one folder in .htaccess - possible?
Posted: Sat Mar 10, 2018 11:03 pm
by MrPhil
By the way, the code in your original post is way bloated, and could be cut down to:
Code: Select all
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !\.(jpe?g|png|gif|css|js)$ [NC]
RewriteRule ^(.+)$ /circkel/
Do you have files with both lowercase and UPPERCASE extensions, and your operating system treats them the same (Windows) or as different (Linux)? Do you really care if there is at least one character before the extension?
Re: Exception for one folder in .htaccess - possible?
Posted: Sun Mar 11, 2018 2:37 pm
by Cleo
Hello,
The code in my original post was the one suggested in an old thread "How to make opencart more secure" or something like that and I never change it because I am not a programmer and don't know much about coding etc. I read a lot in the forum, take good suggestion from people who knows what they are doing (like you, ADD Creative and others) and ask question when I don't find what I need which is not often because the forum is filled with good information from competent people, if we take the time to search we normally find the necessary information when it concerns oc . For the "big problem" I usually hire someone who knows what he is doing to make sure I don't mess everything on my site.
I put an .htaccess in the "Make an offer folder" with the code you suggest "RewriteEngine Off" and tried to make an offer from my cell to have a different IP then the one from my pc and it seems to work.
I don't think I have l UPPERCASE extensions, I always try to keep everything with lowercase, so I should be able to change the .htaccess content with the codes you suggest!
Regards,
Cleo
Re: Exception for one folder in .htaccess - possible?
Posted: Mon Mar 12, 2018 11:15 am
by IP_CAM
I just made a Test, and it all looks well, exept for the quantity, wich is not mentioned
in the Confirmation Info.
Ernie
---
PS: and this is what I got just now in my email:
Code: Select all
Hello Ernie!
Thank you for making an offer on product (Avon Mrs Albee President's Club Plate 2010-2011).
Unfortunately we cannot accept your offer.
Original price: $ 5.00 usd
Your offer: $ usd1.00
Minimum we would accept: $ usd4.00.
Link to product:http://www.lesbricollesdecleo.ca/home-and-garden/collectibles/avon-mrs-albee-presidents-club-plate-2010-2011&product_id=387
End of message

Re: Exception for one folder in .htaccess - possible?
Posted: Mon Mar 12, 2018 11:43 am
by Cleo
Hello IP_CAM,
Thank you very much for your help by trying it! Now I am sure that it is working, by just adding a new .htaccess in the subfolder as suggested
I didn't change the original (main) .htaccess yet to make it smaller because I didn't want to make 2 change at the same time because if something would have go wrong it would have been more trouble to find out which .htaccess was creating a problem.
Now that someone else tried it I can change the main one.
Kind regards,
Cleo
PS: As for the quantity maybe it's because there is only one available?