1

I was searching a lot on this topic, but non of the threads I found worked for me. I want to have a proper permanent rewrite rule for the following:

Anything I tried up to now doesn't capture all subdomains or causes a redirect loop or redirects more than once...

Currently I'm running this, just to have at least www and https:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$  [OR]
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$
RewriteRule (.*) https://www.domain.tld/$1 [R=301,L]

Thanks in advance.

jww
  • 97,681
  • 90
  • 411
  • 885
Roman
  • 11
  • 1
  • Should be working even if i would not have written it that way. About redirect loop, what redirects do you get (you can check http headers) ? – Justin Iurman Aug 26 '14 at 11:34
  • Is this the only rule or you have other rules also? – anubhava Aug 26 '14 at 13:34
  • Hi! In fact it works when I open the URL in Windows/linux browsers, but is doesn't work on android firefox or opera. – Roman Aug 26 '14 at 17:08
  • You may test it for http://domaineck.de works on windows, not on android firefox. Wheird... – Roman Aug 26 '14 at 17:09
  • Possible duplicate of [Apache rewrite from subdomain to www but keep all permalinks](http://stackoverflow.com/questions/7895637/apache-rewrite-from-subdomain-to-www-but-keep-all-permalinks) – jww Aug 26 '14 at 17:22
  • Mmh... I cannot find an error. Jww, What exactly you mean? – Roman Aug 27 '14 at 07:12
  • Hi All! I have checked all the redirects using http://www.redirect-checker.org/. The conclusion is, that all the redirects are working as they should. So no problem with htaccess; I think. But, the redirects are not working on all my android devices (except chrome browser). Do you think this is a htaccess problem or related to the android firefox and opera. I googled, found similar problems, but no solution... – Roman Aug 27 '14 at 10:23

0 Answers0