Open codenathan opened 8 years ago
@Rican7 Please help?
Have you included the route.php
file and instantiated the class?
Hello @nbish11 yes I have ..
Alright then. I'll clone your repository, take a look and get back to you.
@nbish11 Thank you!
The .htaccess is definitely the problem. This is what fixed it for me:
RewriteEngine On
# I've removed "/HubCRM" as I have the "klein-error" project folder inside a virtual host
RewriteBase /public/
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
# Changed the rewrite rule to a more simple one
RewriteRule ^ index.php [L]
Also in your routes.php
don't forget to include the /public/
prefix in your URI's or you could setup Klein to work without the prefix Sub-Directory Installation. Example:
// Notice the "/public" prefix in the URI.
$klein->respond('GET', '/public/hello-world', function () {
return 'Hello World!';
});
$klein->respond('GET','/public/hello',function(){
return "Hello";
});
Thank you @nbish11 . Htacess was what I was least confident in and knew it was somewhere there I made the mistake! Thank you again
:smiley: Glad to be off assistance.
I am having issue with the routing in an MVC env, please have a look at the following repo : - https://github.com/codenathan/klein-error
/public/ is the folder every user will go through
I am trying to get the routing to go through my route.php class under /app/core/route.php
all my routes are definited under /app/routes.php
however non of this are working expect -
I believe this is a misconfiguration in my .htaccess files any help would be greatly appreciated
Please let me know where and which changes i need to make to get this working :)