Solution 1 :

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.

Problem :

My directory structure in apache is as follows:


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, I’d like to remove the index.php and so that it is a bit cleaner:

I’m new to .htaccess files so any help is appreciated 🙂


Comment posted by MrWhite


Comment posted by turkr

The rule should be using ~turkr, sorry! Are you saying it isn’t doing anything?

Comment posted by MrWhite

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


Leave a Reply

Your email address will not be published. Required fields are marked *