.Htaccess redirects even without anything configured

Asked

Viewed 239 times

0

Guys, I recently asked you a question right here at Stack (Doubt in . htacess) about a little htaccess to solve a problem I’m having in the company.

After a good study and begin to understand +/- how things happen I can not find a solution to the following code:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} (\.php)$

#RewriteBase /projetos/c/*****/dev/acompanhamentoobra/
RewriteBase /acompanhamentoobra/

RewriteRule ^(.+)$ index.php?path=$1 [QSA,L]

The problem is this, we have the root folder of the site (www.***.com.br) and several subfolders, all subfolders work and redirect normally but times one in specific (accompanying) that anything I try it does not work.

For example, I have this one. htaccess but if I open the file and delete all the content it still continues with the same stream as if it had not changed anything in the content though if delete the file then from the error.

The root folder of the site has 1 . htaccess vázio and in the folder we have the one that showed the code.

Can any of you see any problems with this code? If you see, please show me!!!

  • If you deleted the entire file and still redirects and you have no other. htaccess, then worth checking your initial index.php, maybe it was redirecting.

  • So ivcs, already check this and the code is normal, another point I forgot to point out is that I have this same project locally, so as the company server I don’t have access to, I’m thinking that mod_rewrite might be inactive.

1 answer

0

Probably found the solution to the problem,

As the same project worked locally so I started to think it was a server error, I tested several and several codes in htaccess and all worked perfectly, but when they were part of mod_rewrite the operation simply stopped.

Going deeper I found the function:

<?php
print_r(apache_get_modules());
?>

"If you come back that the function is not set, it is pq the apache extension is not enabled in php."

Browser other questions tagged

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