dqhsv0147421 2015-06-15 13:40
浏览 101
已采纳

将子域重定向到其子文件夹,Safari显示尝试打开时发生了太多重定向

Possible Duplicate

I did the same. But instead of using .htaccess I put these lines

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

to /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>

After restarting apache2, When I browse one.domain.com , Mozzila, IE Chrome not responding, But safari gives error

Safari Error

  • 写回答

1条回答 默认 最新

  • dongpin1059 2015-06-15 14:30
    关注

    Since it's a 301 you're telling the browser to redirect to one.domain.com/folder which still passes your host condition. Meaning on redirect 2 you're on page one.domain.com/folder/folder

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大