0

我想将https://mineyourmind.de/forum重定向到https://mineyourmind.net/forum

我可以用谷歌搜索的每条重写规则都不起作用,他们还重定向了主域(mineyourmind.de)。

我重定向 http://www。和 http:// 和 https:// 通过 apache 站点配置。

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.mineoyurmind\.de$ [NC]
RewriteRule (.*) https://mienoyurmind.de%{REQUEST_URI} [R=301,L]

论坛目录的 .htaccess 如下所示:

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

<IfModule mod_rewrite.c>
    RewriteEngine On

    #   If you are having problems with the rewrite rules, remove the "#" from the
    #   line that begins "RewriteBase" below. You will also have to change the path
    #   of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo

    #   This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L] 
</IfModule>

我应该将 mineyourmind.de/forum 的重写添加到 mineyourmind.net/forum 到 apache 站点配置或 htaccess 中,这应该是什么样子?

4

1 回答 1

0

如果你只想重定向/forum,那么你想添加这个:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.mineoyurmind\.de$ [NC]
RewriteRule ^forum/(.*) https://mienoyurmind.de%{REQUEST_URI} [R=301,L]

并将其添加到您的 htaccess 文件中RewriteEngine On

于 2013-09-06T20:54:17.080 回答