Amigavel URL does not allow accessing the index of the site

Asked

Viewed 77 times

0

Hello, I have the following code on htaccess

RewriteEngine On

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

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

However when I try to access the main page site.com he says it is not possible to 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';
}
  • is wordpress? think this information depends on how your index works to manipulate the received data

  • RewriteRule ^(.*)$ index.php [QSA, L] starts by correcting that.

  • @Danilod I use Xampp to open the site.

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 remembering, it all depends on how your application works

  • Same thing, when I try to access the error appears ERR_TOO_MANY_REDIRECTS.

  • can put the code of your index?

  • I’ve already edited the question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.