我总是在我的应用程序中使用Forge,但是客户坚持要保留他的GoDaddy。因为我讨厌GoDaddy,所以我遇到了路由问题。主页的工作原理买了我的API得到404.
结构
的public_html
->htaccess
->index.php
->css
->js
->images
->laravel/
->all core stuff
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>
我知道它可能是一些.htaccess因为Laravel结构发生了变化。任何人都知道?????
答案 0 :(得分:0)
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP} off
RewriteCond %{HTTP_HOST} !^https://www.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^111\.111\.111\.111
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* ? [F,L]