-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$baseUrl problem with Router #238
Comments
What does your routes file look like, including the various settings in routes.php? |
I use default router settings, then I added this line: |
I can confirm that setting Also note on routing that absolute paths doesn't work correctly. Example: Code in Routes.php:
Code in a view file:
When clicked on link, shows:
It uses the I currently use URLs without leading slashes, and hard-code them in views, because if I open Current code that works for me: Code in Routes.php:
Code in a view file:
Works as indented, but I don't know which one should be fixed, the Routing or the |
The OP's problem should now be fixed. Thanks for reporting it. @DavisMiculis could you open a new issue for the other problem you're seeing? Too hard to keep things straight with multiple issues in the same post. |
You're welcome. |
I have function like this:
public function testpage()
{
echo 'this is a test page';
}
And added a route like this:
$routes->add('testpage', 'Home::testpage');
When I leave $baseUrl blank, then I access http://ci4.local/testpage, it show the page.
But when I set $baseUrl='http://ci4.local/', then I access http://ci4.local/testpage, it show default CI4 welcome page.
Even I try random uri like http://ci4.local/fdgfdgfdg, it also show default CI4 welcome page instead of 404 error page.
So I think this is a bug that must be solved as soon as possible.
The text was updated successfully, but these errors were encountered: