HTTP to HTTPS (And redirection to other website)

Because you did not use HTTPS

2 Likes

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

Try clearing your cache:

4 Likes

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

3 Likes

Read

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

image

1 Like

That’s TikTok, not my site.

Can you share the .htaccess file?

2 Likes

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

3 Likes

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 / https://www.tiktok.com/@imboredaware

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?

3 Likes

It’s a long discussion, if you wanted that whenever someone types http://example.com or example.com, they should be taken to https://example.com.
Here’s code:

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

ErrorDocument 400 https://bluewinds.rf.gd/e/400.html
ErrorDocument 401 https://bluewinds.rf.gd/e/401.html
ErrorDocument 403 https://bluewinds.rf.gd/e/403.html
ErrorDocument 404 https://bluewinds.rf.gd/e/404.html
ErrorDocument 503 https://bluewinds.rf.gd/e/503.html

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.
https://example.com/err/404.html

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.

2 Likes

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 http://example.com to https://example.com to https://other-site.example.net, or straight from http://example.com to https://other-site.example.net. The first option just slows things down for no reason.

8 Likes

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