View Single Post
  #13  
Old 13th October 2011, 15:35
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Quote:
Originally Posted by Croydon View Post
I don't know if this is really a bug or something weired on my server.

With 3.0.4 Beta 1 and even the current svn from today the redirect functions of subdomains and domain aliases do not work anymore.

I tried to debug it and in the apache2 plugin the rewrite_rules array is correctly filled and sent to tpl system via setLoop().

The master conf section looks like this
HTML Code:
<tmpl_if name="rewrite_enabled">

    RewriteEngine on

<tmpl_if name='seo_redirect_enabled'>

    RewriteCond %{HTTP_HOST} ^<tmpl_var name='seo_redirect_origin_domain'>$ [NC]
    RewriteRule ^(.*)$ http://<tmpl_var name='seo_redirect_target_domain'>/$1 [R=301,L]

</tmpl_if>

<tmpl_loop name="redirects">
    RewriteCond %{HTTP_HOST}   <tmpl_var name='rewrite_domain'>$ [NC]
    RewriteRule   ^/(.*)$ <tmpl_var name='rewrite_target'>$1  <tmpl_var name='rewrite_type'>
</tmpl_loop>
</tmpl_if>
The RewriteEngine On entry is correctly put into the vhost file, but the redirects loop puts out nothing.
The SEO rewrite for the main domain works as intended, but no additional redirect rewrite rules.

Edit: It is a fresh install of ispc on debian squeeze, no update.
The domain alias entries are inserted correctly into the vhost file.
I've just fixed the problem.

The problem was the new <tmpl_loop name="vhosts"> loop in vhosts.conf.master so that we have a nested <tmpl_loop name="redirects"> loop. Nested loops need a special treatment.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote