Difficulty in making RewriteEngine work

0

I need to use this command below. On my server it works fine, but when I went to install that same line of error on the whole site.

I need this because the command will come in differently and I want to mask the original system url. Type:

www.othersite.com/aceita/12315544 or www.othersite.com/recusa/12315544

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /transportadora/cotacoesEnviaPropostaAceitarRecusar.php?acao=$1&id=$2 [L]
    
asked by anonymous 11.12.2015 / 13:02

1 answer

0

First check if it is not your fault in using .htaccess, for example, does your server use Apache or use another one like Ngnix.

Also check if this is in the correct folder or if there is no other folder.

I can not believe you forgot to connect the module, because if it were this would have occurred 500 internal error server .

There is one thing that seems wrong in your rewrite:

You used /transportadora... when the correct would be transportadora... , at least this seems to me the most correct:

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ transportadora/cotacoesEnviaPropostaAceitarRecusar.php?acao=$1&id=$2 [L]

However your rewrite is accepting any action and any id, which is strange, maybe you should try this:

RewriteEngine On
RewriteRule ^(recusa|aceita)/(\d+)$ transportadora/cotacoesEnviaPropostaAceitarRecusar.php?acao=$1&id=$2 [L]
  • The (recusa|aceita) will only accept the predefined actions.
  • The \d+ only accept numbers.
11.12.2015 / 13:24