简体   繁体   English

Laravel迁移问题从URL删除index.php

[英]Laravel Migration Issue Remove index.php from URL

I am just developed a laravel CRUD Application and migrated to live server. 我刚刚开发了laravel CRUD应用程序,然后迁移到了实时服务器。

Currently am accessing the site like http://example.com/index.php/manage-forms/ and its working fine. 目前正在访问http://example.com/index.php/manage-forms/之类的网站,并且可以正常运行。

how can i remove the index.php from URL.? 如何从URL中删除index.php?

i dont have .htaccess in root, am not familiar with .htaccess issues. 我没有.htaccess根目录,对.htaccess问题不熟悉。 can u please share me the .htaccess file for viewing my site like http://example.com/manage-forms/ 您能将我的.htaccess文件分享给我吗,以便查看我的网站,例如http://example.com/manage-forms/

Thanks 谢谢

The .htaccess file is included in the laravel project on its own but if still you missed it in the process of transferring files from local to server add the following code in your .htaccess file under public folder .htaccess文件本身包含在laravel项目中,但如果您仍然从文件本地传输到服务器的过程中错过了它,请在公共文件夹下的.htaccess文件中添加以下代码

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM