为什么Laravel route()会重定向到http://localhostarticle而不是http://localhost/article
blog.conf
DocumentRoot /var/www/blog/public
ErrorLog ${APACHE_LOG_DIR}/blog/error.log
CustomLog ${APACHE_LOG_DIR}/blog/access.log combined
<Directory "/var/www/blog/public">
Options Indexes MultiViews FollowSymlinks
AllowOverride All
Order allow,deny
Allow from All
</Directory>
的.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /
# Redirect Trailing Slashes...
RewriteCond %{REQUEST_URI} !^
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Send requests to public directory...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
答案 0 :(得分:0)
从apache vhost及其帮助中删除所有重定向