Is this laravel question?
redirecting URL problem
Hi please help me I am stuck in the URL problem I post a question but no one replay
I post it also on stack overflow please check the link
https://stackoverflow.com/questions/55365071/problem-with-redirect-to-other-pages-using-uri
What backend framework are you using?
It's not clear whether this is related to Laravel. A clarification will help.
You need to provide more details to get assistance. Even on Stack Overflow they have asked you to provide more details and you haven't. So, with that being said,
• Are you using laravel? • What version of laravel? • Please post relevant code using code blocks example would be three back ticks before and after your code.
Hi thanks for your replay. I am not using any framework it is a cure php I follow the series https://laracasts.com/series/php-for-beginners
and problem occurs in video number 17 Dry Up Your Views video link
https://laracasts.com/series/php-for-beginners/episodes/17
Is anything more to share if you want
thanks
@TOKOIWESLEY - Hi thanks for your replay. I am not using any framework it is a cure php I follow the series https://laracasts.com/series/php-for-beginners
and problem occurs in video number 17 Dry Up Your Views video link
https://laracasts.com/series/php-for-beginners/episodes/17
Is anything more to share if you want
thanks
please check the video in which maybe you understand the problem here the link
https://www.useloom.com/share/5199399f3b5f42dd9c589a47dad0738f
here is the code if you want to review it
Could it be because you have not set the document root correctly?
I don't know if the tutorial expects your routes to be in a sub folder.
When you go to /LearnPHP/about then this works because it is adding about to /LearnPHP/
If you then have a link <a href="culture">Culture<a> then your browser thinks that culture is a sub resource of about so you end up with learnPHP/about/culture which clearly does not exist.
Because you are in a folder, you cannot have an absolute link of /about and /culture because / is also wrong since does not contain learnPHP
The answer is to serve learnPHP as the document root and to fix that, we need to know what web server you use.
@SNAPEY - I use the Linux operating system, web server is Apache, xampp 7.1.26-0
PHP 7.2.15-0ubuntu0.18.04.2 (cli) (built: Mar 22 2019 17:05:14)
@SNAPEY - Hi! snapey thanks for the help
maybe something goes wrong with
Request.php file
I try this
<?php
class Request
{
public static function uri()
{
$uri = (substr($_SERVER['REQUEST_URI'],10));
$removeSlash = rtrim($uri, '/');
return var_dump($removeSlash);
}
}
instead of this
<?php
class Request
{
public static function uri()
{
return trim($_SERVER['REQUEST_URI'], '/');
}
}
I replace the code because it was not working for me
thanks
to follow the tutorial you need to set the document root
There is loads of info on the net how to do this
@SNAPEY - could you please help me how to set the document root. Thanks
@SNAPEY - hi please help me how to set the document root. I am starting this series from start.
Please or to participate in this conversation.