I'm a little stuck with .htaccess, I have some .htaccess code and some redirecting isn't proper. But before I post some .htaccess code, I think it is better to post log output; Notice the "<snip>", it was way longer. I've read the forum rules, so I don't mess around with 4277 bytes of repeating Apache log ouput. Notice also, it is a picture shown. The forum software chewed on it, but since I run a forum of my own, I have understanding for this. It has a date stamp core:error pid of program (36)File name too long: client [not relevant, just a choice I made out of the Apache log] domain.tld shows // [I don't understand, maybe someone can tell me?] HTTP/1.1 to file, referer: [not relevant I find] And the hints; "domain.tld", is https http:// domain.tld works http:// www. domain .tld doesn't seem to work at all/ not sure here if it would work, browsers do make a difference I believe. Notice the spaces, here also the forum software tried to open the posted url. I hope someone can point me in the right direction.
RewriteEngine On RewriteBase / #[https://webmasters.stackexchange.com/questions/69756/wild-card-redirection-for-https-and-non-www-version] RewriteCond %{HTTP_HOST} ^domain\.tld$ RewriteRule ^(.*)$ "https\:\/\/www\.domain\.tld\/$1" [R=301,L] #[https://stackoverflow.com/questions/4083221/how-to-redirect-all-http-requests-to-https/21798882#21798882] RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] Code (markup):
I really hope that someone can help me with this. I'm not expecting working code [but that would be great of course], but I am willing to do something about this myself, but Apache .htaccess just isn't easy and I really needed help from topic from stackoverflow and stackexchange. Please anyone, my topic has over three hundred sixty views now. A good hint or idea would be okay, then I can investigate.
Not that I have been waiting for that, I pitty that this forum doesn't seem to send notifications of replies to a given topic. Or maybe I have overlooked. It seems like I have narrowed things down. For the repeated endless redirects [http 400], most of the visitors [with a reasonable configuration], don't seem to be bothered. And for a part, it seem to be bots and not visitors. And for this error, it was what I was getting, with "Otter Browser", which is kind of to the point with everything it does with the connection with the webserver behind the url given to it. And, since I prefer to keep my browsing history [for my regular browser], some browsers seem to be smartly configured, when this browser "knows", the given url [where I as user, omit the "http"], is a port 80 or 443 and of course, if the connection does have or doesn't have secure socket layer This "smart" browser seemed to me to only once "learn", [remember], what connection it had, thus, it won't fail easy [even when I tried this with my own .htaccess, and if only http headers where simple, but they aren't. Then, two out of more search enignes I've used, showed this redirect loop [thus preventing a visitor to see the webpage], and they seem to have outdated url's, while I believe my redirect switches to https and refuses http, by my configuration. Then, I retried this a day later, and the error wasn't there any longer. So far so good, but, I do keep this redirect error popping up, [in the log file of Apache], but now I learned that "Otter Browser" is able to fail consequently. But I didn't type the 'http' part, this browser does that by itself [which is understandable], but typing https before domain.tld, then it gives the website asked for. However, as far as I can understand, that just bypasses the whole htaccess thing. And visitors just don't type https before www domain.tld and I even just type domain.tld. Now, when I type domain.tld [without www], it shows the webpage. I really do hope someone can help me a little, because, I just don't get it why browsers behave different for something like the difference between http and https [on the other hand, the htaccess I have now instructs Apache on how to give headers to a browser a visitor is using]. Lastly, maybe I'm even overlooking where the redirect I believe I hade from domain.tld to www domain.tld, [that now doesn't even seem to want to appear].