Friendly URL does not allow access to site index

0

Hello, I have the following code in htaccess

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d

RewriteRule (.*) index.php [QSA,L]

But when I try to access the main page site.com it says it can not access.

index.php

<body>
    <?php
        require 'config/tratarUrl.php';
        include $pag;
    ?>
</body>

treatUrl.php

if(file_exists(DIR_PAGES.$url[0].'.php'))
{
    $pag = DIR_PAGES.$url[0].'.php';
}
    
asked by anonymous 22.03.2017 / 19:22

1 answer

0

I believe the following code will work for you

# BEGIN
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
</IfModule>
# END

But remember, it all depends on how your application works

    
22.03.2017 / 19:33