我在設置新服務器後想出了這個問題。當我點擊一個路由時,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. laravel 5.2項目沒有在url上添加index.php沒有運行
- 2. index.php在www後添加。用的.htaccess
- 3. 如何在Laravel 5.2中路由localhost url
- 4. 從Laravel的URL中刪除index.php
- 5. 從URL刪除index.php,Laravel 5.2
- 6. CodeIgniter轉義乾淨的URL添加index.php/
- 7. 從laravel url中刪除/public/index.php
- 8. index.php在wordpress中使用虛擬主機在url中添加
- 9. 如何刪除index.php並在CodeIgniter URL中添加www?
- 10. http://localhost/index.php重定向到http:// localhost/xampp/
- 11. 爲什麼IIS將URL添加到URL的localhost/default.aspx?
- 12. php:在url中刪除index.php
- 13. 無法從laravel url中刪除index.php?在Ubuntu 14.04
- 14. 將URL重寫爲index.php,但避免在URL中使用index.php
- 15. WordPress的 - 添加類別index.php
- 16. index.php作爲laravel網站的url中的參數
- 17. Laravel 5.1 Localhost中的SSL
- 18. 如何從laravel 5的url中刪除public/index.php?
- 19. 如何刪除url中的index.php? (laravel 5.3,PHP 7)
- 20. Codeigniter從url中刪除index.php並在視圖中添加外部css
- 21. 如何添加URL後綴
- 22. URL重寫的index.php
- 23. 爲什麼CodeIgniter將/index.php/添加到所有URL?
- 24. .htaccess問題將www添加到url並刪除index.php
- 25. 如何在url中添加字符串ID? Laravel 5.3
- 26. 添加在laravel 5.4
- 27. 在添加部署配置後使用localhost進行WebStorm調試?
- 28. Laravel向後兼容的URL
- 29. 從CodeIgniter URL中刪除index.php
- 30. 從cakephp url中刪除index.php
https://stackoverflow.com/questions/37507209/how-to-hide-config-files-from-直接訪問 –
同樣的結果。每次我點擊它仍然重定向的東西index.php –
這意味着你沒有正確設置網絡服務器,或者你沒有重新啓動它。 –