Redirect using aliasdomains and flag "L" goes into loop

Discussion in 'Installation/Configuration' started by buhlerax, Apr 7, 2012.

  1. buhlerax

    buhlerax New Member

    I have a client with the domain xxxxxxxxx.com.br, by default ispconfig creates the folder /var/www/clients/clientX/WEBX/web.

    He created a subdirectory of /var/www/clients/clientX/WEBX/web/SiteY.

    He then recorded another domain yyyyyyyy.com.br.

    He wants the domain xxxxxxxxx.com.br open the folder /var/www/clients/clientX/WEBX/web and that the domain yyyyyyyy.com.br open the folder var/www/clients/clientX/WEBX/web/SiteY .

    I tried this with aliasdomain, but it does not work the browser goes into loop.
    How can I do this in ispconfig?
    thank you

    Alexandre Pereira B├╝hler
    http://www.simaoebuhler.com.br
     
  2. falko

    falko Super Moderator

    What are the exact settings you use in ISPConfig? Can you post the vhost configuration file of the xxxxxxxxx.com.br website?
     
  3. buhlerax

    buhlerax New Member

    enable: CGI, SSI, Ruby, Phyton, auto-subdomain (www.), mod-php

    vhost not redirect:
    <Directory /var/www/xxxxxxx.com>
    AllowOverride None
    Order Deny,Allow
    Deny from all
    </Directory>

    <VirtualHost *:80>
    DocumentRoot /var/www/xxxxxxx.com/web

    ServerName xxxxxxx.com
    ServerAlias www.xxxxxxx.com
    ServerAdmin webmaster@xxxxxxx.com

    ErrorLog /var/log/ispconfig/httpd/xxxxxxx.com/error.log

    Alias /error/ "/var/www/xxxxxxx.com/web/error/"
    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 502 /error/502.html
    ErrorDocument 503 /error/503.html

    <IfModule mod_ssl.c>
    </IfModule>

    <Directory /var/www/xxxxxxx.com/web>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

    # ssi enabled
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Options +Includes
    </Directory>
    <Directory /var/www/clients/client6/web7/web>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

    # ssi enabled
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Options +Includes
    </Directory>

    <IfModule mod_ruby.c>
    <Directory /var/www/xxxxxxx.com/web>
    Options +ExecCGI
    </Directory>
    RubyRequire apache/ruby-run
    #RubySafeLevel 0
    <Files *.rb>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
    </Files>
    <Files *.rbx>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
    </Files>
    </IfModule>

    <IfModule mod_python.c>
    <Directory /var/www/xxxxxxx.com/web>
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    PythonDebug On
    </Directory>
    </IfModule>

    # cgi enabled
    <Directory /var/www/clients/client6/web7/cgi-bin>
    Order allow,deny
    Allow from all
    </Directory>
    ScriptAlias /cgi-bin/ /var/www/clients/client6/web7/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    # Clear PHP settings of this website
    <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
    </FilesMatch>
    # mod_php enabled
    AddType application/x-httpd-php .php .php3 .php4 .php5
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@softidei as.com"
    php_admin_value upload_tmp_dir /var/www/clients/client6/web7/tmp
    php_admin_value session.save_path /var/www/clients/client6/web7/tmp
    # PHPIniDir /var/www/conf/web7

    # add support for apache mpm_itk
    <IfModule mpm_itk_module>
    AssignUserId web7 client6
    </IfModule>

    <IfModule mod_dav_fs.c>
    # Do not execute PHP files in webdav directory
    <Directory /var/www/clients/client6/web7/webdav>
    <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
    </FilesMatch>
    </Directory>
    # DO NOT REMOVE THE COMMENTS!
    # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
    # WEBDAV BEGIN
    # WEBDAV END
    </IfModule>

    php_admin_value open_basedir "none"
    <Directory /var/www/xxxxxxx.com/web/arquivos>
    Options +Indexes
    </Directory>

    </VirtualHost>


    vhost to aliasdomain:

    <Directory /var/www/xxxxxxx.com>
    AllowOverride None
    Order Deny,Allow
    Deny from all
    </Directory>

    <VirtualHost *:80>
    DocumentRoot /var/www/xxxxxxx.com/web

    ServerName xxxxxxx.com
    ServerAlias www.xxxxxxx.com
    ServerAlias www.yyyyyyy.com.br yyyyyyy.com.br
    ServerAdmin webmaster@xxxxxxx.com

    ErrorLog /var/log/ispconfig/httpd/xxxxxxx.com/error.log

    Alias /error/ "/var/www/xxxxxxx.com/web/error/"
    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 502 /error/502.html
    ErrorDocument 503 /error/503.html

    <IfModule mod_ssl.c>
    </IfModule>

    <Directory /var/www/xxxxxxx.com/web>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

    # ssi enabled
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Options +Includes
    </Directory>
    <Directory /var/www/clients/client6/web7/web>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

    # ssi enabled
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Options +Includes
    </Directory>

    <IfModule mod_ruby.c>
    <Directory /var/www/xxxxxxx.com/web>
    Options +ExecCGI
    </Directory>
    RubyRequire apache/ruby-run
    #RubySafeLevel 0
    <Files *.rb>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
    </Files>
    <Files *.rbx>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
    </Files>
    </IfModule>

    <IfModule mod_python.c>
    <Directory /var/www/xxxxxxx.com/web>
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    PythonDebug On
    </Directory>
    </IfModule>

    # cgi enabled
    <Directory /var/www/clients/client6/web7/cgi-bin>
    Order allow,deny
    Allow from all
    </Directory>
    ScriptAlias /cgi-bin/ /var/www/clients/client6/web7/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    # Clear PHP settings of this website
    <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
    </FilesMatch>
    # mod_php enabled
    AddType application/x-httpd-php .php .php3 .php4 .php5
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@xxxxxxx.com"
    php_admin_value upload_tmp_dir /var/www/clients/client6/web7/tmp
    php_admin_value session.save_path /var/www/clients/client6/web7/tmp
    # PHPIniDir /var/www/conf/web7

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^xxxxxxx.com$ [NC]
    RewriteRule ^(.*)$ http://www.xxxxxxx.com$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^xxxxxxx.com$ [NC]
    RewriteRule ^/(.*)$ /$1 [R]
    RewriteCond %{HTTP_HOST} ^www.xxxxxxx.com$ [NC]
    RewriteRule ^/(.*)$ /$1 [R]
    RewriteCond %{HTTP_HOST} ^yyyyyyy.com.br$ [NC]
    RewriteRule ^/(.*)$ /yyyyyyy/$1 [L]
    RewriteCond %{HTTP_HOST} ^www.yyyyyyy.com.br$ [NC]
    RewriteRule ^/(.*)$ /yyyyyyy/$1 [L]

    # add support for apache mpm_itk
    <IfModule mpm_itk_module>
    AssignUserId web7 client6
    </IfModule>

    <IfModule mod_dav_fs.c>
    # Do not execute PHP files in webdav directory
    <Directory /var/www/clients/client6/web7/webdav>
    <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
    </FilesMatch>
    </Directory>
    # DO NOT REMOVE THE COMMENTS!
    # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
    # WEBDAV BEGIN
    # WEBDAV END
    </IfModule>

    php_admin_value open_basedir "none"
    <Directory /var/www/xxxxxxx.com/web/arquivos>
    Options +Indexes
    </Directory>

    </VirtualHost>
     
  4. falko

    falko Super Moderator

    You have two vhosts for xxxxxxx.com???

    Is it possible that you enabled the SEO redirect for xxxxxxx.com? If so, make sure the first drop-down says "No redirect" and that the second field is empty.
     

Share This Page