oldrock
oldrock

Reputation: 871

.htaccess not working

I have done a fresh installation of xampp , after installing the folder containing following htaccess file is not showing in my browser.

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

it gives 500 error and the server is overloaded

This happens when I am trying to execute the public folder in my zend application.

Please suggest to me whether I have to do any modifications in my xampp for getting my .htaccess file to execute correctly.

Thanks in advance

Upvotes: 3

Views: 2763

Answers (1)

nitro2k01
nitro2k01

Reputation: 7745

1) Make sure you've enabled mod_rewrite in the Apache configuration file.

2) Add the line AllowOverride All to the directory configuration in the Apache config file.

Additionally, unless you have a lot of rewrites, I recommend the following over your current rules.

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [NC,L]

Upvotes: 5

Related Questions