.htaccess file not getting loaded - .htaccess

I am using Netbeans in Linux environment to develop my project. I have put my .htaccess in Web pages folder in Netbeans. But my .htaccess file is not getting loaded.
Now as suggested in many forums I wanted to change <Directory/> tag in /etc/httpd/conf/httpd.conf file. But There are many such tags. My question is which one I have to edit?
I want this file to affect whole directory. So putting it in web pages folder is ok or not?
It might be a repeat question but I could not find a solution in any forum.
Note: I have tried putting garbage or deny from all in .htacces file it is not getting loaded for sure.

Related

Redirect issue with cake php and html folder

I have a website in cake php host on a domain root(www.example.com/) directory it work fine. Now the issue is i placed a html template on www.exapmle.com/html but when i open this in browser it rdirect to website means www.example.com and seen cake php website.
One thing that is asked quite a lot on #cakephp is how to use other apps alongside CakePHP, and the answer giving is normally pretty ugly. Stick the files/folders in side webroot/. Although that does work, its not very nice. So ill show you a little trick with .htaccess files.
The first (really simple way) is to use a .htaccess inside the sub folder. For example you can have a copy of Joomla! running alongside cake with no issues when you have the .htaccess for Joomla! enabled. If the app does not have one and/or you would not know what to put in the .htaccess file you have another option
Make Apache stop processing rewrites if it finds a request for your sub directory. This is done by adding a rule for the sub directory and then telling Apache it is the last rule to process. The .htaccess file you want to edit is the one found inside your APP directory. All you want to add is the following line:
You can do this for as many sub folders as you wish, by changing the regex accordingly. Its pretty simple to do and a much cleaner way than having all your stuff inside the webroot/ folder of your APP.
Source : http://goo.gl/kOEZ9Y

How to hide directory listing of my website (a shared hosting)?

I'm trying to hide the directory listing of my website.
I'm currently working on a website hosted by 'hostinger'.
I know that i should change something in an apache-related file, but they(hostinger) say that
i cannot change that. cuz im using a 'shared' hosting service.
so the only way is to add some code in an .htaccess file.
RewriteEngine On
Options -Indexes
this is my current situation in my .htaccess file.
i've googled the info on how to do it, but it keeps listing my directory.
is there any way that i can prevent it?
or is it just impossible to accomplish with a shared hosting service?
Try this , prevent or allow the server to display the index of the files in the folders of your web server.
You can put a .htaccess file in each of your directory with this code
Options All -Indexes

.htaccess not working with .cfm pages on Railo

I want to do some very basic .htaccess stuff like block a directory by IP address. I know why this problem is happening, I just don't know how to fix it. I've read every post I can and there doesn't seem to be a consensus on how to fix it. Railo/Tomcat is grabbing control of the page before .htaccess rules are applied.
I am running Centos with Railo / Tomcat / Apache. I believe I am using mod_cfml, at least that's what's under the connector folder.
I have tried putting my .htaccess files in httpd.conf without any luck. I'm not sure I was doing that correctly, but I dropped the code into the virtual domain section of the site I'm working on.
Has anyone got this to work properly?
On iis you can change the order modules run which would solve that issue Asbyou would tell the htaccess module to run before mod_cfml
Can you do that on Apache?

What is .htaccess file. Why we use this file. what are the advantages of using this file? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
what is .htaccess file in php?
As per my research this file is used for Url rewrites.
It allows you to set or modify per-directory configuration settings without having to change configuration files or restart the server.
.htaccess allows you to micromanage permissions. Apache generally discourages its use unless it's overriding a general behavior since it can be slower (if parent folder does not contain .htaccess, it must then check the parent of parent folder for .htaccess on up to the root folder).
However that doesn't mean it can't be useful, simply that you must be tactful in its usage. Where general apache configuration is to a bulldoser, .htaccess would be to a shovel. Just know when to pick a bulldoser over a shovel and you'll be fine.
A decent article can be found here regarding .htaccess.

question about htaccess file

what is htaccess file? how to create and write that? what is the advantage of using htaccess file?
.htaccess files provide a way to make configuration changes on a per-directory basis. See the official Apache documentation for .htaccess files.
.htaccess allows you to override Apache's (and other servers') main configuration file for a particular directory (and all its subdirectories). To use .htaccess you simply create a new file and name it ".htaccess" (yes, the name is very unusual because it actually consist of only a very long file extension), upload it to you server (if you want to affect your entire site than put is in your root folder), and finally add some directives.
If you wand to see what sort of things you can configure with .htaccess check out this very accessible tutorial: 5 most useful applications of the .htaccess file.
For something more comprehensive visit guide .htaccess.
Hope this helps
This is majorly used for configuration on server the generally things involve in usage are following.
-(redirecting server to specific file)
Redirect permanent /index.html (new path)
For more you can refer to http://httpd.apache.org/docs/2.0/howto/htaccess.html#related

Resources