我遵循了这个示例"using-mod-rewrite-to-redirect-home-page-only“,但我不确定它在https/SSL上是否起作用,网站主页是https://www.somasimple.com,我希望它被重定向到https://www.somasimple.com/forums/home我在htaccess文件=>的末尾尝试了,但没有成功
RewriteEngine on
RewriteCond %{HTTP_HOST} ^somasimple\.com$
RewriteRule (.*) https://www.somasimple.com/$1 [R=301,L]
RewriteRule ^$ forums/home [L]发布于 2017-08-02 23:20:40
要从https://www.somasimple.com重定向到https://www.somasimple.com/forums/home,只需在virtualhost中添加一个简单的重定向匹配,不需要mod_rewrite或任何其他复杂的麻烦。
<Virtualhost *:443>
ServerName www.somasimple.com
DocumentRoot /path/to/docroot
SSLEngine on
#.... (other SSL directives)
# Redirect / to /forums/home
RedirectMatch ^/$ /forums/home
</Virtualhost>https://stackoverflow.com/questions/45459440
复制相似问题