laravel remove index.php from url

    # Remove index.php$
    if ($request_uri ~* "^(.*/)index\.php$") {
        return 301 $1;
    }

    location / {
        try_files $uri $uri/ /index.php?$query_string;

        # Remove from everywhere index.php
        if ($request_uri ~* "^(.*/)index\.php(/?)(.*)") {
            return 301 $1$3;
        }
    }

    # Remove trailing slash.
    if (!-d $request_filename) {
        rewrite ^/(.+)/$ /$1 permanent;
    }

    # Clean Double Slashes
    if ($request_uri ~* "\/\/") {
        rewrite ^/(.*) /$1 permanent;
    }
This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.