Hi, we have Webspaces that require Redirects like http://domain.tld to https://ww.domain.tld At the moment they are done in two steps: 1. http://domain.tld -> http://www.domain.tld || SEO Redirect 2. http://www.domain.tld -> https://www.domain.tld || Rewrite HTTP to HTTPS Our SEO Team like to have this done in one step. Is this possible by configuring it or do I need to customize it within the "Apache Directives" section?
Thanks for you reply. However, this is just what I'm doing right now. This adds a redirect from http to https, which is my 2nd point. I want to have a redirect from http://domain.tld to https://www.domain.tld in ONE step. PS: I edited my first post to make it a bit clearer
Now I get your question. The SEO redirect is applied to both web sites, while the HTTP->HTTPS redirect is obviously only applied to the HTTP web site. So I guess it cannot be done in ISPConfig, not even by adding an Apache Directive (which would get applied to both websites again), without modifying server/conf/vhost.conf.master To do so, first copy the file to server/conf-custom/vhost.conf.master and then edit line 448: NEW: <tmpl_if name='rewrite_to_https' op='==' value='y'> NEW: RewriteRule ^(.*)$ https://<tmpl_var name='seo_redirect_target_domain'>$1 [R=301,NE,L] NEW: <tmpl_else> 448: RewriteRule ^(.*)$ http<tmpl_if name='ssl_enabled'>s</tmpl_if>://<tmpl_var name='seo_redirect_target_domain'>$1 [R=301,NE,L] NEW: </tmpl_if>
You could do this in apache directives if you want (using mod_rewrite or a Redirect), but +HSorgYves solution is nice - seems like the correct solution to be included in a merge request, no? (@till ?)
True @Jesse Norell , I first thought applying it to both sites would create a loop, but as we check for ^domain\.tld$ first, it works. So @A.Bauer you can also add the following two lines to your apache directives and disable both redirects in ISPConfig: RewriteCond %{HTTP_HOST} ^domain\.tld$ [NC] RewriteRule ^(.*)$ https://www.domain.tld$1 [R=301,NE,L]
@HSorgYves , your change works like a charm! I would love the have this in the next Patch of ISPconfig!