Hi all, I have a site that is set up in suck way that root directory is not set to: /var/www/clients/client1/web1/web but /var/www/clients/client1/web1/web/subfolder/ now I had to do this because the app was set up in such way and thats ok because I changed the DocRoot using Apache Directive in ISPconfig. The problem started to occur when I created a subdomain for that website. I added a subdomain, creted a directory for that subdomain and added L redirect as sugested in some post I found on this forum. Next I created A record for this subdomain in DNS settings. Now, while the site itself works a subdomain is not and gives this error: Code: [Wed May 14 11:28:07 2014] [error] [client xxx.xxx.xxx.xxx] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Wed May 14 11:28:07 2014] [debug] core.c(3112): [client xxx.xxx.xxx.xxx] r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php [Wed May 14 11:28:07 2014] [debug] core.c(3118): [client xxx.xxx.xxx.xxx] redirected from r->uri = / [Wed May 14 11:28:07 2014] [debug] mod_deflate.c(615): [client xxx.xxx.xxx.xxx] Zlib: Compressed 751 to 427 : URL /index.php Also a htaccess file for this subdomain looks like this: Code: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L]
Anyone with a idea? It seems that Im unable to create subdomain for a website if a root folder for main site is set to subfolder like in my case in: /var/www/clients/client1/web1/web/subfolder/
Did you try it with this htaccess rewrite instead of the above? Code: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*$ index.php [QSA,L]
<Directory /var/www/domain.com> AllowOverride None Order Deny,Allow Deny from all </Directory> <VirtualHost *:80> DocumentRoot /var/www/domain.com/web ServerName domain.com ServerAlias www.domain.com ServerAlias subdomain.domain.com ServerAdmin [email protected] ErrorLog /var/log/ispconfig/httpd/domain.com/error.log Alias /error/ "/var/www/domain.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/domain.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/client1/web15/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/domain.com/web> Options +ExecCGI </Directory> RubyRequire apache/ruby-run #RubySafeLevel 0 AddType text/html .rb AddType text/html .rbx <Files *.rb> SetHandler ruby-object RubyHandler Apache::RubyRun.instance </Files> <Files *.rbx> SetHandler ruby-object RubyHandler Apache::RubyRun.instance </Files> </IfModule> <IfModule mod_perl.c> PerlModule ModPerl::Registry PerlModule Apache2::Reload <Directory /var/www/domain.com/web> PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI </Directory> <Directory /var/www/clients/client1/web15/web> PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI </Directory> <Files *.pl> SetHandler perl-script </Files> </IfModule> <IfModule mod_python.c> <Directory /var/www/domain.com/web> <FilesMatch "\.py$"> SetHandler mod_python </FilesMatch> PythonHandler mod_python.publisher PythonDebug On </Directory> </IfModule> # cgi enabled <Directory /var/www/clients/client1/web15/cgi-bin> Order allow,deny Allow from all </Directory> ScriptAlias /cgi-bin/ /var/www/clients/client1/web15/cgi-bin/ <FilesMatch "\.(cgi|pl)$"> SetHandler cgi-script </FilesMatch> # suexec enabled <IfModule mod_suexec.c> SuexecUserGroup web15 client1 </IfModule> # Clear PHP settings of this website <FilesMatch ".+\.ph(p[345]?|t|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 [email protected]" php_admin_value upload_tmp_dir /var/www/clients/client1/web15/tmp php_admin_value session.save_path /var/www/clients/client1/web15/tmp # PHPIniDir /var/www/conf/web15 php_admin_value open_basedir /var/www/clients/client1/web15/web:/var/www/clients/client1/web15/private:/var/www/clients/client1/web15/tmp:/var/www/domain.comf/web:/srv/www/domain.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin RewriteEngine on RewriteCond %{HTTP_HOST} ^subdomain\.domain\.com$ [NC] RewriteCond %{REQUEST_URI} !^/webdav/ RewriteCond %{REQUEST_URI} !^/php5-fcgi/ RewriteCond %{REQUEST_URI} !^/subdomain/ RewriteRule ^/(.*)$ /subdomain/$1 [L] # add support for apache mpm_itk <IfModule mpm_itk_module> AssignUserId web15 client1 </IfModule> <IfModule mod_dav_fs.c> # Do not execute PHP files in webdav directory <Directory /var/www/clients/client1/web15/webdav> <ifModule mod_security2.c> SecRuleRemoveById 960015 SecRuleRemoveById 960032 </ifModule> <FilesMatch "\.ph(p3?|tml)$"> SetHandler None </FilesMatch> </Directory> DavLockDB /var/www/clients/client1/web15/tmp/DavLock # DO NOT REMOVE THE COMMENTS! # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE! # WEBDAV BEGIN # WEBDAV END </IfModule> DocumentRoot "/var/www/clients/client1/web15/web/defroot" </VirtualHost>
Okay and your subdomain lies in /web/defroot/subdomain/ If not, then this might be the reason it doesn't work.
Okay.. So just try replacing this line in the vhost file: Code: RewriteRule ^/(.*)$ /subdomain/$1 [L] by this one Code: RewriteRule ^/(.*)$ /subdomain/$1 [PT] for testing.