我在htaccess文件中有设置代码。将https://www.website.com/重定向到https://website.com/,但两个链接的工作方式相同。
SetEnv PHPRC /home/customer/www/website.com/public_html/php.ini
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
RewriteCond %{HTTP_HOST} ^www.website.com [NC]
RewriteRule ^(.*)$ http://website.com/$1 [L,R=301]
</IfModule>
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
# Disable Directory listing
Options -Indexes
# block files which needs to be hidden, specify .example extension of the file
<Files ~ "\.(env|json|config.js|md|gitignore|gitattributes|lock)$">
Order allow,deny
Deny from all
</Files>
</IfModule>
<IfModule mod_headers.c>
Header set Cache-Control "private"
</IfModule>
AddHandler application/x-httpd-php80 .php .php5 .php4 .php3
1条答案
按热度按时间wnavrhmk1#
试试这个