Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1499

Force https, non-www, and turn queries into paths

$
0
0

I posted a fairly incoherent request for help, which has been received. I have now gotten something that seems to work. It forces the use of "https://" in place of "http://; forces "example.org" in place of "www.example.org:" and removes "FramesVar.html?" from a URL with a nameless query string. I would appreciate some advice and/or correction. One question, is the [NC] needed?

For example, doing all of these things at once causes

"http://www.gilbertmunger.org/FrameVars.html?Pages/ID43.h

to become

"https://gilbertmunger.org/Pages/ID43.html"

(I have gotten rid of frames, but there are anchors using them still hiding in other sites.)

    RewriteEngine On    RewriteBase /    RewriteCond %{QUERY_STRING} !^$    RewriteRule ^(.*)$ https://gilbertmunger.org/%{QUERY_STRING} [QSD,R=301,L]    RewriteCond %{HTTP_HOST} ^www\.gilbertmunger\.org$ [NC]    RewriteRule ^(.*)$ https://gilbertmunger.org/$1 [R=301,L]

MANY THANKS.

I tried many formulations until this one seems to be working.


Viewing all articles
Browse latest Browse all 1499

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>