【问题标题】:Changing .htaccess file in order to allow subdomains更改 .htaccess 文件以允许子域
【发布时间】:2013-05-29 08:36:21
【问题描述】:

我在我的域中托管一个 Wordpress 页面,我想创建一个子域以便同时托管一个 wiki 页面。

例子:

www.foowordpress.com -> Points to a Wordpress blog
wiki.foowordpress.com -> It should point to a Media Wiki page

Wordpress 生成的 .htaccess 似乎将所有子域重定向到 Wordpress 索引页。

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

有人可以建议如何更改此 .htaccess 文件以免重定向 wiki 子域吗?

我已经配置了我的 DNS 管理器和我的 VirtualHost 来创建这个子域。

【问题讨论】:

    标签: wordpress .htaccess apache2 subdomain virtualhost


    【解决方案1】:

    事实证明,我没有正确配置 VirtualHost 文件,.htaccess 文件没有任何问题。

    这是我的子域的 VirtualHost 文件,以防有人发现它有用:

    <VirtualHost *:80>   
      # Admin email, Server Name (domain name), and any aliases  
      ServerAdmin webmaster@foo.com   
      ServerName  www.wiki.foo.com
      ServerAlias wiki.foo.com
    
      # Index file and Document Root (where the public files are located) 
      DirectoryIndex index.html index.php   
      DocumentRoot /var/www/wiki.foo.com/
    
      # Log file locations   LogLevel warn   ErrorLog 
      /var/log/apache2/wiki.foo.com/error.log   CustomLog
      /var/log/apache2/wiki.foo.com/access.log combined 
    </VirtualHost>
    

    【讨论】:

      猜你喜欢
      • 2020-05-26
      • 1970-01-01
      • 2013-07-31
      • 1970-01-01
      • 2017-11-10
      • 2014-02-15
      • 2018-09-19
      • 2013-11-27
      • 1970-01-01
      相关资源
      最近更新 更多