HTTP to HTTPS (And redirection to other website)

Because you did not use HTTPS


If I type https:// or http:// for your URL, I get redirect to TikTok either way.

Try clearing your cache:


I know, but I can’t change that?

I want it to be https for redirection, not HTTP

I just don’t see any option to change that.

Any other way to redirect? That’s always starting with HTTP

What do you want to change? The redirect works fine over both HTTP and HTTPS



1 Like

I already said, it appears as not secure for new people visiting it. I don’t like that.

I think you are not even reading what I’m saying.

I already mentioned that above.

Not true, appeared as https to me


1 Like

That’s TikTok, not my site.

Can you share the .htaccess file?


Solve it yourself. We are not obliged to help you since you cannot even write properly


That’s why I’m asking for help. I already explained everything above.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Redirect 301 /

Hold on, I mistyped before, there should be two htaccess files, on in htdocs and one in the root.

Can you share the full contents of both of them?


It’s a long discussion, if you wanted that whenever someone types or, they should be taken to
Here’s code:

DirectoryIndex index.php index.html index.htm index2.html

ErrorDocument 400
ErrorDocument 401
ErrorDocument 403
ErrorDocument 404
ErrorDocument 503

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:CF-Visitor} !{"scheme":"https"}
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Delete htaccess from root. Create new one inside htdocs/, paste the code.
Remember to change error pages to your own.

1 Like

I don’t know if it’s because you’ve changed something, but your site already works the way you want it to. It just isn’t seen by the naked eye because, immediately after redirecting visitors to the HTTPS version, it redirects them to TikTok as you intended it to.

You can see what I mean by using a tool that traces redirects, such as the one I used.


I just stopped using infinityfree.

This thread can be closed.

Just FYI: our own redirects tool only shows http:// as prefix in the list, but it also redirects https://, http://www. and https://www..

I’m not entirely sure where and how you got the “not secure” error, but I can tell you that if you want to redirect a website over HTTPS, the source domain also needs to support HTTPS, i.e. have a valid SSL certificate.

And both redirecting an entire site and setting up forced HTTPS is unnecessary. It really doesn’t matter if you redirect from to to, or straight from to The first option just slows things down for no reason.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.