I
I
Ibrahim Tubaev2021-10-02 14:52:25
PHP
Ibrahim Tubaev, 2021-10-02 14:52:25

How to configure mod_rewrite and .htaccess?

Help me please!
I had a problem when installing the script on the site, I get an error 500 on the site. The only installation requirement not met is mod_rewrite. I installed it, but I don't know how to connect it. I suspect that the problem is in the root .htaccess file.
In the error log it shows like this:

[Sat Oct 02 13:55:28.600616 2021] [core:error] [pid 22034] [client 40.77.167.65:2368] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.


The .htaccess file itself
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^$1 [N]

    RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
    RewriteRule ^(.*)$ public/$1 

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ server.php
    
</IfModule>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question