Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7502275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:48:34+00:00 2026-05-29T20:48:34+00:00

I’m still playing with Kohana, and found another stopper for me :-) I’ve created

  • 0

I’m still playing with Kohana, and found another stopper for me 🙂

I’ve created a new simple controller called compte.php and is located inside /app/classes/controller/compte.php

<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Compte extends Controller {

public function action_index()
{
    $this->response->body('hello, world comptes!');
}
} // End Comptes

Why I can’t go to this controller with this url?

http://127.0.0.1/~user/kohana/compte/

This url works:

http://127.0.0.1/~user/kohana/

I’ve edited the routes in the bootstrap.php file but without success, sure I’m missing something …

If I use the default route to point to my controller comptes, I can see it ok, but I want to know how to go directly to this controllers.

 Route::set('compte', '()') ->defaults(array( 'controller' => 'compte', 'action' => 'index', ));

thanks!

EDIT

I’m getting the error 404 Not Found error from Web Server, not from Kohana

EDIT 2

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /~user/kohana/

# Protect hidden files from being viewed
<Files .*>
    Order Deny,Allow
    Deny From All
</Files>

# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]

Also the file is located at the same level as the examples.htaccess but renamed to .htaccess, in the kohana folder

EDIT 3

I’ve followed for third time the tutorial linked, the initial problem was with Apache, now the 404 is from Kohana:

HTTP_Exception_404 [ 404 ]: Unable to find a route to match the URI: compte

This is my only route in bootstrap.php

 Route::set('compte', '') ->defaults(array( 'controller' => 'compte', 'action' => 'index', ));

If I enter an URL without any controller, I can see the default compte Controller, but if I use compte or comptes or whatever, always 404 not found …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:48:36+00:00Added an answer on May 29, 2026 at 8:48 pm

    Regarding edit 3:

    Your route only matches an empty URI string. ‘compte’ or ‘comptes’ are not empty strings.
    If you want the route to match an empty URI as well as the URIs ‘compte’ and ‘comptes’ then use this:

    Route::set('compte', '(compte(s))')
        ->defaults(array(
            'controller' => 'compte',
            'action' => 'index',
        ));
    

    The whole thing is optional so it can match an empty URI. The ‘s’ is optional too once ‘compte’ is present. Routing is very powerfull once you get to know it, which you can here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.