MrUnknow
MrUnknow

Reputation: 399

laravel htaccess not work

i want to rewrite this url : sample.com/panel/index.php/api/users?page=1 to sample.com/panel/api/users?page=1 (remove index.php) and here is my .htaccess file :

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

but that is not work ! why ?

i use from apache2 ver 2.4 in ubuntu

Upvotes: 1

Views: 1214

Answers (1)

Dygnus
Dygnus

Reputation: 641

Have you checked whether mod_write is enabled?: sudo a2enmod rewrite

Have you check whether the virtual host is allowed to use .htaccess? Requires AllowOverride all in your virtual host configuration.

Upvotes: 1

Related Questions