This should do the trick.
RewriteRule ^.*$ api/index.php [R=301,L]
And, if it’s just a typo. Your file must be named .htaccess
.
This should do the trick.
RewriteRule ^.*$ api/index.php [R=301,L]
And, if it’s just a typo. Your file must be named .htaccess
.
My directory structure in apache is as follows:
turkr/
public_html/
api/
index.php
.htacess
index.php
is my front controller for my APIs, so every endpoint should be directed to this file. So far I’ve accomplished this with this in my api/.htacess
file:
RewriteEngine on
RewriteRule ^(.*).php/$ /~turk/api/$1.php [R=301,L]
However, instead of using www.example.com/~turkr/api/index.php/someTable
, I’d like to remove the index.php
and so that it is a bit cleaner:
www.example.com/~turkr/api/someTable
I’m new to .htaccess
files so any help is appreciated 🙂
/~turkr/api/index.php/someTable
The rule should be using ~turkr, sorry! Are you saying it isn’t doing anything?
If the URL as stated is the URL you are currently requesting then yes, that rule is not doing anything. What do you think that rule is doing? Also, the