在此服务器上找不到请求的URL/ProjectName/users.拉拉韦尔

编程入门 行业动态 更新时间:2024-10-20 05:31:27
本文介绍了在此服务器上找不到请求的URL/ProjectName/users.拉拉韦尔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在关注laravel的快速入门,它说"type /users",但对我不起作用. 我已经在浏览器中写了DomainServer/ProjectName/users并抛出:

I am following the quickstart of laravel and it said "type /users" but not working for me. I have wrote in the browser, DomainServer/ProjectName/users and it throws:

在此服务器上找不到请求的URL/ProjectName/users. Laravel

The requested URL /ProjectName/users was not found on this server. Laravel

我尝试了以下方法,

要启用apache模块mod_rewrite,它也不起作用.

To enable the apache module mod_rewrite and also does not work.

推荐答案

Linux环境中Apache Web Server和Laravel的步骤.

Steps for Apache Web Server and Laravel in Linux Environment.

  • 打开httpd.conf

  • Open httpd.conf sudo vim /etc/httpd/conf/httpd.conf # for debian users: /etc/apache2/apache2.conf

  • 确保DocumentRoot指向laravel项目的公共目录

  • Make sure the DocumentRoot is pointing to the laravel project's public directory

    为该路径添加Directory元素,并全部允许Allowoverride ...,如下所示

    Add the Directory element for that path and Allowoverride All... as follows

    DocumentRoot "/var/www/html/laravel/public/" <Directory "/var/www/html/laravel/public"> Allowoverride All </Directory>

  • 从../laravel/public/中打开.htaccess,并确保它具有以下内容

  • Open .htaccess from ../laravel/public/ and make sure it has the following

    <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>

  • 重新启动httpd服务

  • Restart httpd services

    sudo service httpd restart

  • 现在DomainServer/users将在您的浏览器中运行.

  • Now DomainServer/users will work in your browser.

  • 更多推荐

    在此服务器上找不到请求的URL/ProjectName/users.拉拉韦尔

    本文发布于:2023-10-31 15:59:05,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1546569.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:在此   找不到   拉拉   韦尔   器上

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!