PHP simple way to create REST API
Go to solution
Solved by Hazy125,
The key is in your htaccess file. You probably have one auto generated by your server in your root directory. If you don't see it there, make sure you are searching for hidden files. And if its definitely not there, it is easy enough to create. Just create a file named ".htaccess"
In your htaccess file add the following text
RewriteRule ^api/ api.php
This sends the requests to the api directory to the api.php file where you can grab the URL and do all the PHP'y things
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now