Difficulty making Rewriteengine work

Asked

Viewed 43 times

0

I need to use this command below. On my server works well, but when I went to install on another this same line of error throughout the site.

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

www.outrosite.com/accept/12315544 or www.outrosite.com/refusal/12315544

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /transportadora/cotacoesEnviaPropostaAceitarRecusar.php?acao=$1&id=$2 [L]
  • Have you checked whether apache rewrite mode is active? What is the error? puts the error print on the question to help answer.

  • 1

    Try this http://pastebin.com/BNhp6Ts5

1 answer

0

First check that it is not your fault in using . htaccess, for example, does your server use Apache itself or use another as Ngnix.

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

I can’t believe you forgot to turn on the module, because if it was, it would have happened 500 internal error server.

There’s one thing that seems wrong in your rewrite:

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

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

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

RewriteEngine On
RewriteRule ^(recusa|aceita)/(\d+)$ transportadora/cotacoesEnviaPropostaAceitarRecusar.php?acao=$1&id=$2 [L]
  • The (recusa|aceita) will only accept pre-defined actions.
  • The \d+ only accept numbers.

Browser other questions tagged

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