【问题标题】:Redirecting subdomain to its sub folder, Safari showing too many redirect occured trying to open将子域重定向到其子文件夹,Safari 显示太多重定向尝试打开
【发布时间】:2015-06-15 13:40:34
【问题描述】:

Possible Duplicate

我也是这样做的。但我没有使用.htaccess,而是把这些行

RewriteEngine On
RewriteCond %{HTTP_HOST} ^one\.domain\.com  
RewriteRule ^(.*)$ /folder/$1 [R=301]

到 /etc/apache2/sites-available/default.

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride All          // I even changed None to All
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All          // I even changed None to All
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride All
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined


        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^one\.domain\.com  
        RewriteRule ^(.*)$ /folder/$1 [R=301]
</VirtualHost>

重启apache2后,浏览one.domain.com时,Mozzila,IE Chrome无响应,但safari报错

【问题讨论】:

    标签: php redirect apache2 debian


    【解决方案1】:

    因为它是 301,所以您告诉浏览器重定向到 one.domain.com/folder 仍然通过您的主机条件。重定向 2 上的含义是您在第 one.domain.com/folder/folder 页面上

    【讨论】:

    • 完成了。我删除了它。它的工作方式与预期一样。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-10
    • 2014-09-05
    • 2012-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多