【问题标题】:Wordpress MU: www. to the http://WordPress MU:万维网。到 http://
【发布时间】:2012-10-04 19:30:43
【问题描述】:

在我的 .htaccess 中,我必须在其中添加什么才能创建通配符,所以如果有人访问 www.*.domain.co.nz,它将重定向到 http://*.domain.co.nz

我可以让它为一个域工作,但我点击了其他域。

在这个阶段,我有一个 index.html 作为保留页面,但我也希望能够访问 wordpress 的 index.php

我使用的是标准 MU .htaccess

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]

【问题讨论】:

    标签: wordpress .htaccess wildcard


    【解决方案1】:

    你试过了吗:

    RewriteCond %{HTTP_HOST} ^(www\.)(.*)$ [NC]
    RewriteRule ^(.*)$ http://%2/$1 [L,R=301]
    

    您需要将其放在您的 htaccess 文件中 RewriteBase / 的正下方。

    【讨论】:

      猜你喜欢
      • 2015-10-15
      • 2015-11-15
      • 2010-11-20
      • 2015-01-09
      • 1970-01-01
      • 1970-01-01
      • 2013-08-16
      • 1970-01-01
      • 2014-08-22
      相关资源
      最近更新 更多