Home Unsafe connection after changing rules in .htaccess
Reply: 2

Unsafe connection after changing rules in .htaccess

FabMon
1#
FabMon Published in 2017-12-04 23:52:40Z

I'm trying to set rules to change the URL from page contact.php to contact but the website now show unsafe connection in the main page but not on other pages.

This is the rule i used:

RewriteRule ^contact(.[A-Za-z0-9-]+)/?$ contact.php?=$1

While i still haven't set this clean URL yet, it's strange the website isn't using a secure connection anymore.

The link is here. Even if i clear the rule it is still unsecure and even if you write https:// in the URL, after navigating through other pages and back to the main page again it is not secure anymore.

Can you give me insight from this?

Kingson
2#
Kingson Reply to 2017-12-05 00:09:07Z

I just checked your site. For every absolute URL you need to have https and not http as the protocol or use relative URLs. So please check your HTML a-tags. To also have the main site in https you should add another rewrite rule:

RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

Another thing is to fix the current contact regex to:

RewriteRule ^contact([.A-Za-z0-9-]*)/?$ contact.php?=$1
SilverSlug
3#
SilverSlug Reply to 2017-12-05 00:05:34Z

This may not be answering you question directly, but when I need to change a url i use javascript. You can try...

var obj = { Title: 'Contact Us', Url: '/contact'};
history.pushState(obj, obj.Title, obj.Url);

This would allow the browser to see the page as intended from the server and just show the url.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.339448 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO