oscommerce allow running script independently on different folder - .htaccess

I have oscommerce installed on a domain (www.myoscommercesite.com), but now i want to run an independent script (www.myoscommercesite.com/myindependentscript) but getting a 404 message
I have tried adding this into htaccess file
<FilesMatch "\.(php)$">
Order Deny,Allow
Allow from all
</FilesMatch>
But problem still there
Thanks

Related

FilesMatch in .htaccess file no longer working

I used to use this code on my old shared hosting, but have switched to a VPS, but it does not seem to work as intended.
<FilesMatch "\.(inc|log|exe|sql|ini|conf|bin)$">
Deny from all
</FilesMatch>
I'm trying to block access to these extentions, but if I type in a file that does not exist it still puts 403 forbidden and not 404 not found. Any idea why?
Thank you

allow wget & php deny from rest

SetEnvIf User-Agent .*Wget* wget
Order deny,allow<br>
Deny from all<br>
Allow from env=wget
ErrorDocument 403 /403.shtml
So I am currently using the above lines of text inside my htaccess file, and it works perfectly. The problem is I need to allow access to a mailer.php file that is also listed in that directory.
Is there a way i can allow access to just this file and use the above code yet to block out the rest?
And if it matters, the phpfile writes to a file inside that directory... it is called rc3.key (not sure if that is important but i think it could be)
Just add the following:
<Files "mailer.php">
Allow from all
</Files>
This will allow everyone to access mailer.php but will throw a 403 error for every other file.

.htaccess, deny to download files within a directory

I am trying to deny everyone to download anything inside the "attachment" directory.
My website structure is:
public_html
-img
-css
-root
--attachment
---(numeric id)
----(files)
-js
What I am trying to do is, to deny access to root/attachment//
I tried many things, but I don't know why, I cannot get it working, my last tried was:
.htaccess - on main directory.
<FilesMatch "root/attachment/.*/.*">
Order Allow,Deny
Deny from all
</FilesMatch>
Any ideas?
Thank you very much :)
FilesMatch doesn't work with directories.
Create a new .htaccess inside root/attachment/ as
<FilesMatch ".*">
Order Allow,Deny
Deny from All
</FilesMatch>
Redirect rules specified in a parent directory .htaccess apply to its sub-directories as well. In case, these access rules do not work the same way, just move the .htaccess directly into files directory.
Create a new htaccess file /root/attackment/.htaccess and add the following lines
Order Allow,Deny
Deny from all

How to keep certain files exempt from .htaccess redirect?

I have one website (www.mysite.com) that I have on a temporary redirect to another folder (www.mysite.com/tempfolder/index.php). I also host another site in the root folder of www.mysite.com called www.subsite.com. It has it's own URL, but I can't figure out how to make that entire sub-folder exempt from the redirect! Any ideas? Here is what my .htaccess file looks like right now (which is perfectly redirecting everything to the temporary landing page).
<Limit GET POST PUT>
order deny,allow
deny from all
allow from ***
allow from ****
allow from *****
</LIMIT>
ErrorDocument 403 http://www.mysite.com.com/tempfolder/index.php
<filesMatch ".(htm|html|php|css|js|php|gif|jpg|db|png)$">
order allow,deny
allow from all
</FilesMatch>
Any ideas? thanks all!
try putting an .htaccess file in the subfolder that does not contain the redirection rules. That should work just fine -- it can even be a blank file.

.htaccess file is protecting all of my directories. How can I allow access to one?

I've got a folder on my server called dvd and I've put an index file in this folder. If i go directly to /dvd/index.html I can view the file. However, if I go only to /dvd/ I get a 403 forbidden error. I'm sure I can allow access to the /dvd/ folder but I can't figure out how. Below is the filesmatch code i'm using at the moment. Can someone please tell me what it is I'm supposed to be doing? Thanks
<FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
Order allow,deny
</FilesMatch>
Add
DirectoryIndex index.html
to the .htaccess, seems like it's not set if you can view it directly.

Resources