Recently I started working with .htaccess file to redirect API call to a specific file. However, even though my .htaccess file is working (tested it with just text on top of the file and I get "Internal Server Error") my rule is not working. Instead, Index.php is always read. The goal is, whenever the url ends with "myOwnAPI/" it takes you to the file "somefile.php". All files(index.php, somefile.php, .htaccess) leave in the same directory.
The .htaccess file contains just one rule.
Please help.
httpd.conf file
<Directory />
AllowOverride All
Require all denied
</Directory>
AllowOverride All
.htaccess file
RewriteEngine on
RewriteRule ^myOwnAPI/?$ somefile.php [NC,L]
question from:
https://stackoverflow.com/questions/65899394/rewrite-rule-not-redirecting-to-the-specified-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…