我已按照以下步驟從url中刪除index.php。我正在laravel 5上工作,並且我已經跟着insrtuection刪除了index.php和url ..但是我無法訪問我的views文件夾和使用url的頁面。只有像www.art.local這樣的主鏈接正在工作www.art.local/index/register這不起作用。 請幫助無法從URL訪問laravel 5中的視圖
Renaming the server.php to index.php (no modifications)
Copy the .htaccess from public
Changing .htaccess it a bit as follows for statics:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} ! (\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
後,我已經使用這個代碼: – yogeshwari
我改變/Illuminate/Foundation/helpers.php/asset()函數如下: 功能的資產($路徑,$ secure = null) { return app('url') - > asset(「public /".$ path,$ secure); } – yogeshwari