in Web server by (12.3k points)
0 like 0 dislike
4 views

Me need configure exact match with RewriteRule without regex. Using an exact match instead of a regex is fine for my case. How I can to setup exact value for Apache mod_rewrite RewriteRule directive without use regular expressions?


rewriterule without regular expressions
rewriterule without regex

1 Answer

0 like 0 dislike
by (12.3k points)

In Apache mod_rewrite rules there is way you can use RewriteCond to make it match literal strings without regular expressions using equals sign (=) before matching patten like this:

RewriteCond %{REQUEST_URI} =/views/index.php
RewriteRule ^ /views/index.xml [L]

Space after caret symbol (^) is necessary, because we still use two parameters in RewriteRule Apache mod_rewrite directive.

Your answer

Try to answer the question as detailed as possible.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.