0

I am working on a Rest Api for my application. This is my application structure

 api -config -modules --v1 ---controllers ---models -runtime -tests -web backend common console environments frontend 

I tried runing the following url http://192.168.1.4/~user/urshow/api/modules/v1/web/users

I got a Not found Error. I do have a controller named Users inside controllers folder.

My .htaccess file is like this (which is inside urshow/api/web)

RewriteEngine on RewriteBase /~user/urshow/api/modules/v1/web/ # If a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward it to index.php RewriteRule . index.php 
4
  • Try to create controller with name UserController Commented Dec 22, 2015 at 19:48
  • If you disable pretty urls, and remove the .htaccess file, does your site work and what do the urls look like? Commented Dec 29, 2015 at 5:41
  • still getting the same not found error @JoeMiller and i tried like this 192.168.1.3/~user/urshow/api/web/movies/details Commented Dec 29, 2015 at 5:48
  • If you've disabled pretty urls then your urls should look something like this 192.168.1.3/index.php?r=movies/details Commented Dec 29, 2015 at 6:15

2 Answers 2

1

I found the solution. I had made some mistakes. First my .htaccess file was incorrect.

i had this line before RewriteBase /~user/urshow/api/modules/web/

i changed it to RewriteBase /~user/urshow/api/web/

also the url which i was trying was also wrong http://192.168.1.4/~user/urshow/api/web/movies/details

correct url is http://192.168.1.4/~user/urshow/api/web/v1/movies/details.

Sign up to request clarification or add additional context in comments.

Comments

0

You haven't added the rest of the url to the redirect. Try using this on your last line;

RewriteRule ^(.*)$ index.php$1 

1 Comment

it didn't work still i have erorr The requested URL /~user/urshow/api/modules/v1/web/index.phpusers was not found on this server.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.