Posts

Showing posts with the label .Htaccess

CodeIgniter Htaccess And URL Rewrite Issues

Answer : There are 3 steps to remove index.php . Make below changes in application/config.php file $config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/Your Ci folder_name'; $config['index_page'] = ''; $config['uri_protocol'] = 'AUTO'; Make .htaccess file in your root directory using below code RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] Enable the rewrite engine (if not already enabled) i. First, initiate it with the following command: a2enmod rewrite ii. Edit the file /etc/apache2/sites-enabled/000-default Change all AllowOverride None to AllowOverride All . Note: In latest version you need to change in /etc/apache2/apache2.conf file iii. Restart your server with the following command: sudo /etc/init.d/apache2 restart Your .htaccess is slightly o...

Apache Server Ignores .htaccess

Answer : <Directory "/home/page_url/www/"> AllowOverride None This AllowOverride None disables .htaccess files from being read. See the manual. Also, please bear in mind that there's nothing magical about .htaccess files. They are a crude workaround for not having full access to the server configuration. All they are is a piece of Apache configuration. If you have full access to the server configuration, you should be putting stuff like this into the vhost configuration, not .htaccess files. As Jim said, if you have full access to your server, you should just put everything in the server configuration files. I reached here because I thought my server was ignoring my own htaccess/server configuration files. However, it turned out I had mod_expires and mod_rewrite disabled. After I had those two looked into, everything was working again as it should. You can enable them by executing these commands: sudo a2enmod expires sudo a2enmod rewrite ...

Apache: Client Denied By Server Configuration

Answer : Apache 2.4.3 (or maybe slightly earlier) added a new security feature that often results in this error. You would also see a log message of the form "client denied by server configuration". The feature is requiring an authorized user identity to access a directory. It is turned on by DEFAULT in the httpd.conf that ships with Apache. You can see the enabling of the feature with the directive Require all denied This basically says to deny access to all users. To fix this problem, either remove the denied directive (or much better) add the following directive to the directories you want to grant access to: Require all granted as in <Directory "your directory here"> Order allow,deny Allow from all # New directive needed in Apache 2.4.3: Require all granted </Directory> OK I am using the wrong syntax, I should be using Allow from 127.0.0.1 Allow from ::1 ... In Apache 2.4 the old access authorisation syntax has been depr...