Welcome Guest, Not a member yet? Register   Sign In
How to remove index.php from URL in CodeIgniter ec2 elastic Beanstalk
#7

(07-21-2021, 08:48 PM)InsiteFX Wrote: Add to your .htaccess file where index.php is in public folder.

Code:
    # Remove index.php from URL
    RewriteCond %{HTTP:X-Requested-With}    !^XMLHttpRequest$
    RewriteCond %{THE_REQUEST}              ^[^/]*/index\.php [NC]
    RewriteRule ^index\.php(.*)$            $1 [R=301,NS,L]










finally got it
created a file in nginx (/etc/nginx/conf.d/elasticbeanstalk/01modrewrite.conf)
code :
location / {

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

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


Messages In This Thread
RE: How to remove index.php from URL in CodeIgniter ec2 elastic Beanstalk - by gibin - 07-28-2021, 11:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB