我有一個Laravel 4應用程序,它在XAMPP本地工作正常。在URL中沒有「公共」的子文件夾中的Laravel 4
我已經將它上傳到域名 - domain.com - (與godaddy一起),並將其放置在hcr文件夾中。
在HCR /應用/配置/ app.php我有
'URL'=> 'http://domain.com/hcr',
在HCR /公共/ htaccess的我有
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /hcr
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
</IfModule>
,並在HCR /的.htaccess我有
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /hcr
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
刪除public from url。
我可以訪問http://domain.com/hcr/並加載頁面(沒有樣式,圖像,...)。 但頁面,圖像,CSS,JS,...的所有其他鏈接都是錯誤的。 例如,它們鏈接到
http://domain.com/css/styles.css
而不是鏈接到
http://domain.com/hcr/css/styles.css
即 「HCR」 缺少從所有鏈接。
如果我去
http://maintimeline.com/hcr/public/
一切工作正常,但我的網址,這是我想刪除具有「公共」。
那麼,如何從.htaccess文件的url中刪除「public」呢?
感謝您的答覆。這是另一個解決方案,從url中擺脫「公共」文件夾。我對此很清楚。但那不是我想要的。我想讓它與.htaccess文件一起工作,並理解它爲什麼現在不能正常工作...... – nunomira