deny from all in .htaccess not blocking file in the corresponding folder - .htaccess

I have an .htaccess file in the folder called folder and another file, called form.html in the same folder
When I try to reach the folder (by entering http://blablabla/folder/), it does block the access and I am getting an error 403 but when I enter the exact URL of the file http://blablabla/folder/form.html anf hit enter, I can access the file as easily as if I haven't put any .htaccess file.
Am I doing something wrong?
Am I missing something, should I use something like or
Sorry if the question is really basic...

.htaccess is a container for directives for your apache web server that apply to that directory and below only. What directives have you got in your .htaccess file?
The behaviour you outline above is how apache should behave with no .htaccess folder.
What is it that you are wanting to happen?

Related

Can't access files on Magento root

I am looking to install an SSL on my domain name and in order to do so I need to upload a .htm file to the root and access it via the browser, but when I do so, I keep getting a 404 error - this is with any .html page on the root - nothin shows up.
I have edited my htaccess file as well as deleting it all together and still no luck.
The file i'm trying to reach is: http://www.elmershardware.co.uk/xtt5ughh.htm
If someone could help point me in the right direction of fixing this I'd be really appreciative
Thanks
G
I think there is nothing to do with .htaccess. It's something related with your apache conf.
In your apache configuration file check if in DirectoryIndex appears
index.htm as a entry, add it if it doesn't appears and restart apache. Then , try again

Could not access php file on core modules's external folder in social engine4

I have installed the plugin 'Advanced Search Plugin Like Facebook Search' of younet and I noticed the error that application/modules/Core/externals/scripts/ynadvsearch.php is not found.
Then I checked the location and the file was there. So I uploaded a test.php file and typed the url in address bar then also I could not access the test.php page. But I am able to access all the js pages on that folder.
I have deleted the htaccess file of external folder. But the issue remains the same.
How can we fix this?
It's a little weird, usually /externals/scripts folder is used only for javascript-files (and all php-files - inside of /controllers folder).
File .htaccess inside of /externals folder contains a rule
<FilesMatch "\.avi|flv|mov|wmv|wma|mp3|mp4|m4a|mkv|swf|pdf|doc|ppt|ico|jpg|jpeg|png|gif|js|css)$">`
It means that *.php files are not allowed for access inside of this folder.

Redirect localhost subaddress to another folder

My "htdocs" folder is set to this: C:\webserver\xampp\htdocs
All my folders exist in subfolders of this folder.
I have such another folder here: c:\MyProjects\project1
I need to htaccess rewrite so, when I write: http://127.0.0.1/project1/myfile.php
On my browser, I will see the result of "myfile.php" inside "project1" folder.
Is it possible?
Is it possible?
No, you can't rewrite a URI outside of your document root, C:\webserver\xampp\htdocs. And htaccess file sitting in that htdocs directory won't be able to point a request outside of the htdocs directory. Mod_rewrite isn't what you want anyways. You want to use mod_alias from within the vhost config or server config. Something along the lines of:
Alias /project1 C:/MyProjects/project1
See also: Make XAMPP/Apache serve file outside of htdocs

How to disable effects of .htaccess within a subfolder if there is a .htaccess file in root?

In my application I have separate spaces for user and admin like
if www.example.com is my website, then www.example.com/admin is my admin URL.
I am using a .htaccess file in my root, and it affects some of the functionality in my admin folder, which I don't want to.
For example, consider below is my folder structure
..
.htaccess
index.php
admin
So if I don't want the .htaccess rules to apply within the admin folder, is there any way?
For people that don't have direct access to httpd.conf (shared hosting for example), just put another .htaccess file in the subfolder and set to the desired behavior.
You should be able to do this, but it does require write access to the httpd.conf configuration.
If you have access to the httpd.conf file, something like
<Directory /admin>
AllowOverride None
</Directory
should do the trick.
Also, note that using .htaccess files in the root directory (as you said you did) is not a recommended approach. You'd be better off moving the contents of the htaccess file into the proper contexts of the httpd.conf file.
More information can be found at http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride

CakePHP htaccess modification to allow vBulletin

I'm looking to set-up a vBulletin install next to a CakePHP install. I was planning on just popping the the vB folder into webroot, but when accessing the folder in my browser, it loses the short URL (i.e. it goes from .com/community to .com/app/webroot/community)
Because of this I wanted to put the vB folder into the root of the directory, next to the app directory, so I can access it directly via .com/community - but the htaccess file is getting in the way, complaining that it can't find the community controller.
So my question is this - what edits do I need to make to the htaccess file for it to allow access to the /community folder directly.
Thank you
Add the following line to your .htaccess file:
RewriteRule ^(community).* - [NC,L]
This will allow direct access to the community folder which is in root directory. Accessing http://localhost/community would be possible after adding this rule.

Resources