0

I set up an apache manually and added a second web directory with this code:

Alias /webs c:\webs
<Directory /webs>
    AllowOverride All
</Directory> 

However, this web has an .htaccess file in it and accessing the website gives the error: "500 Internal Server Error", but does not write anything in the error log file.

But when I remove the .htaccess file, I don't get this error.

I added the "AllowOverride All" line and restarted the server but this doesn't correct the error.

My .htaccess is this:

RewriteEngine On
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?params=$1 [L,QSA]

<Files "test">
    Order Allow,Deny
    Allow from all
</Files>

What do I have to do so that I can use an .htaccess file in this directory?

  • What are you trying to do with <Files "test"> ? – NickW Sep 2 '14 at 9:25
1

Enable mod_rewrite in Apache web server. Also try this:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?params=$1 [L,QSA]

    <Files "test">
        Order Allow,Deny
        Allow from all
    </Files>
</IfModule>

If mod_rewrite is enabled then initiates the rewrite engine; else it does nothing.

0

OK, I fixed this, it turned out to be two other issues, which I'll record here just in case it helps someone:

In my php.ini file, I had to set:

display_errors = On

so that it would display errors (even though I had "error_reporting = E_ALL & ~E_STRICT").

Then the error was that I was trying to use RedBean with SQLite and needed to uncomment these in my php.ini file:

extension=php_pdo_sqlite.dll
extension=php_sqlite3.dll

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.