我在设置新服务器后想出了这个问题。当我点击一个路由时,laravel在本地主机之后放置一个index.php。例如localhost/index.php/mysite/public/login.
如何在localhost后删除index.php
?laravel在localhost后添加URL中的index.php
1
A
回答
0
请确保您有内部与下面的代码公共文件夹的.htaccess文件:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
+0
我已经有.htaccess,但结果相同。 –
+0
您正在使用哪个服务器? –
+0
即时通讯使用Windows Server 2012 R2 –
相关问题
- 1. 如何在magento url中添加index.php?
- 2. Laravel URL :: route和index.php
- 3. laravel 5.2项目没有在url上添加index.php没有运行
- 4. 如何在Laravel 5.2中路由localhost url
- 5. index.php在www后添加。用的.htaccess
- 6. 从Laravel的URL中删除index.php
- 7. 从URL删除index.php,Laravel 5.2
- 8. Joomla和默认的index.php添加到URL
- 9. CodeIgniter转义干净的URL添加index.php/
- 10. 从laravel url中删除/public/index.php
- 11. Laravel添加样式的URL?
- 12. index.php在wordpress中使用虚拟主机在url中添加
- 13. Mode_rewrite将index.php添加到url结尾
- 14. 新的URL正在追加localhost url
- 15. index.php追加到url
- 16. 从URL中移除笨的index.php后
- 17. 如何删除index.php并在CodeIgniter URL中添加www?
- 18. http://localhost/index.php重定向到http:// localhost/xampp/
- 19. 为什么IIS将URL添加到URL的localhost/default.aspx?
- 20. 如何重写URL这样的http://localhost/gestor_3.0/index.php P = cadastros&T = operadoras
- 21. 在Laravel中附加到url
- 22. 无法从laravel url中删除index.php?在Ubuntu 14.04
- 23. CSS在url中有index.php
- 24. php:在url中删除index.php
- 25. 将URL重写为index.php,但避免在URL中使用index.php
- 26. WordPress的 - 添加类别index.php
- 27. index.php作为laravel网站的url中的参数
- 28. Laravel 5.1 Localhost中的SSL
- 29. 主页不加载没有index.php在url,example.com/index.php
- 30. 如何从Laravel 5.1的url中删除index.php?
https://stackoverflow.com/questions/37507209/how-to-hide-config-files-from-直接访问 –
同样的结果。每次我点击它仍然重定向的东西index.php –
这意味着你没有正确设置网络服务器,或者你没有重新启动它。 –