Lets say I have http://example.com as my website.
Now, when I do http://example.com/api/login, the login script works.
But when I do http://example.com, it goes straight to the default switch cause in my router setup for index.php in the htaccess file which shows echos Access Denied.
It doesnt show the website in either case.
All files are in the public_html folder for hosting.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php [QSA,L]
Thats my current htaccess file. What do I do to fix this problem?
2
Answers
I fixed it by creating a new folder in public_html called backend I changed the htaccess to
I placed all things related to the backend there and it works now
What are the contents of your base folder? By default php will always open
index.php
file if you want to head for the login page instead which in your case ishttp://example.com/api/login
then edit your index.php file to redirect to it withplaced at the top of the index.php script