【发布时间】:2014-08-29 04:20:01
【问题描述】:
我的网站在virtualmin 控制面板的虚拟服务器上运行,目前它正在重定向302 临时URL,而我在.htaccess 文件中添加了重定向规则。
这是我的.htaccess文件配置:
Options -Indexes
RewriteEngine On
RewriteBase /
RewriteRule ^index.html$ index.php
RewriteRule ^(([a-zA-Z0-9-_]+)?)\.html$ page.php?pagId=$1
RewriteCond %{http_host} !^example.com$ [nc]
RewriteRule ^(.*)$ https://example.com/$1 [r=301,nc,L]
请让我知道我需要对我的网络服务器进行哪些更改,以便正确重定向 301 永久重定向?
我想以这种 URL 格式“https://example.com/”重定向对我的域的所有请求。
【问题讨论】:
标签: apache .htaccess mod-rewrite redirect