【发布时间】:2021-08-11 19:42:57
【问题描述】:
我正在为我的网站使用 PHP、Laravel 8 框架和 cPanel。我正在尝试做的是这样的事情。
从
重定向路由http://example.com/example.com/public/
http://example.com/example.com/public/about
http://example.com/example.com/public/contact
.
.
// more
到
https://example.com/
https://example.com/about
https://example.com/contact
.
.
// more
我在域根目录public_html 文件夹中有.htaccess 文件。
.htaccess 文件
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^example.com$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /example.com/public/$1 [L]
如果我做错了什么,请指导我。
【问题讨论】:
-
能否请您告诉我们这些规则仅存在于您的 htaccess 文件中,还是您有更多规则?
-
我只有这么多
example.com/public文件夹我有laravel默认的htaccess文件。
标签: .htaccess redirect mod-rewrite https friendly-url