I noticed that most of the frameworks (CodeIgniter for example), do provide a default .htaccess file but don’t force its use.
- Why don’t they force its use?
- Does .htaccess work on all servers?
- What are the alternatives?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
.htaccessfiles only work on apache servers. When using other servers it highly depends on what you want to do – but usually you need to edit the server config to rewrite URLs, block directories, etc.The fact that frameworks need .htaccess files is actually an annoying problem from the PHP world since 99% of all applications are stored inside the document root, thus giving users HTTP access to all their files unless they are somehow restricted (e.g. via .htaccess). On the other hand, if you have a WSGI-based python application, you usually store it outside the document root and “mount” it to a certain folder in the document root – this way not a single file can be accessed directly via HTTP.