.htaccess does not work

0
Hello, I already use these .htaccess rules and it has never given me a problem, so much so that I use it in other providers now, I would like to know if the apache or php version on the hosting server is in the way of running the rules.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ^produto(|/)$ produto.php
RewriteRule ^produto/(.*)$ produto.php/$1

ErrorDocument 403 //403.php
ErrorDocument 404 //404.php
ErrorDocument 500 //500.php

The PHP version is 5.5, the provider does not access the apache version, currently running on Linux 5.2. The hosting site is locaweb.

    
asked by anonymous 12.08.2017 / 18:27

1 answer

0

As I was not able to fix the problem with the solution that works on my server, I had to change the code that fetches the data in the database, so I changed it to a GET on the page and added a foreach and modified the .htaccess.

.htaccess is:

RewriteRule ^produto(|/)$ produto.php?/id=$1
RewriteRule ^produto/(.*)$ produto.php?id=$1

the page is:

$prod = $_GET['id'];
$muda_path = explode('/', $prod);
foreach($muda_path as $produto){...}
    
28.10.2017 / 20:17