0
我可以通過http://localhost/rnd/public/coeg-admin
訪問我的網址,但是如果我訪問http://localhost/rnd/public/coeg-admin/
,它會被重定向到http://localhost/coeg-admin
。Laravel 5:帶尾部斜槓的URL被重定向到本地主機
我只是按照laravel trailing Slashes redirect to localhost和URL with trailing slashes gets redirected to localhost in laravel 5
但它不能按預期工作,這是我的.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Set base URL
# RewriteBase /rnd/public/
# RewriteRule ^(.*)/$ /$1 [L,R=301]
# RewriteCond %{REQUEST_URI} !^
# 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]
</IfModule>
這裏是我的apache2.conf
<Directory "/var/www/html/rnd/public">
Options Indexes FollowSymLinks
#AllowOverride None
AllowOverride All
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
如何,我也可以把帶末尾斜線的網址到最後沒有斜線的網址?
謝謝,任何幫助表示讚賞。