Subdomain redirect to its subfolder, Safari showing too many redirects occurred while trying to open

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]

      

in / 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 is not responding, but safari gives error

Safari Error

+3


source to share


1 answer


Since it is 301, you are telling the browser to redirect to one.domain.com/folder, which is still passing your host state. Value for redirect 2 you are at one.domain.com/folder/folder



+1


source







All Articles