regex - 500 internal error on regular linux hosting for php
336
here is my code in .htaccess
<Directory "/">
AllowOverride All
</Directory>
RewriteEngine on
RewriteRule ^custom contactus.php[NC L]
Remote site path or my all website files contains in /www
current url :example.com/contactus.php
expected output url:example.com/custom
Answer
Solution:
Try the following rule.
Answer
Solution:
Invalid htaccess file
A Directory directive is invalid in a
.htaccess
file:Note that
.htaccess
is not a valid context. Similarly, AllowOverride is also invalid in a.htaccess
file:Were it valid in a
.htaccess
file, it would defeat the purpose of what the directive is for.Valid example
The entire contents of the
.htaccess
file to do what's in the question are:I.e. If mod rewrite is enabled, apply that rewrite rule. Note that the syntax for rewrite flags is a comma separated list.