RewriteRule specific case for a URL

2

I have .htaccess rewriting the URLs and a submenu being dynamically created and I need one of these links to open on a different URL / page than the rest.

You're like this:

RewriteRule conheca/(.+)/(.+)/$ conheca.php?id=$1&slug=$2

I need the specific case conheca/2/equipe-pastoral/ to be directed to equipe-pastoral.php and not to conheca.php , as is the case with the remaining URLs.

Using

RedirectMatch 301 conheca/2/equipe-pastoral/$ page_diferente.php

It has been able to distinguish itself from the others, however, error 500 even happens to page_diferente.php existing.

    
asked by anonymous 15.03.2014 / 17:27

1 answer

4

Just put the specific rule for this page before the general rule, and use the flag [L] in the specific rule to indicate that after it, the following rules should be ignored.

See more about rewriterule and rewritecond in this question:

Rewrite URL for root access but not block access to sub-domains

    
15.03.2014 / 17:46