You are not logged in.
I would like to have this url:
http://myhost.com/index.php?option=com_ … &Itemid=23
to become the https one.
This far I have tried this rule:
RewriteEngine On
RewriteCond %{REQUEST_URI} ".*com_weblinks.*"
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
Someting is wrong with my voodoo here, but I don't know what...
Offline
This is how it works for me:
RewriteEngine on
RewriteRule ^/(.*)$ https://%{SERVER_NAME}/$1 [R,L]
Offline
This is how it works for me:
RewriteEngine on RewriteRule ^/(.*)$ https://%{SERVER_NAME}/$1 [R,L]
I have been meaning to know how to enable clean URLs. I use Drupal and have tried to edit .htaccess many ways (including your above) without success.
Offline
This snippet from IBM has been working for me, too:
RewriteEngine on
RewriteCond %{SERVER_PORT} =80
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI}
and by using an extra RewriteCond %{REQUEST_URI} ^(.*administrator.*) also has worked nicely to enable ssl protection just over dirs like http://myhost.com/administrator/
It seems too much to protect the whole site - I'd like to have just parts of the sites that have certain words in their URLs or URIs.
Offline
go by https if its: www.example.com/test?foobar
# Activate the Rewrite engine
RewriteEngine On
# You only want to go by https if the QueryString CONTAINS foobar (after a ? in the URL)
RewriteCond %{QUERY_STRING} .*foobar.*
# he requestet /test .. so you can match on /test ... then y EXTERNAL REDIRECT him to you self but using https this time ... the Query_string automagically gets apended
RewriteRule ^/test$ https://www.example.com/test [R,L]
if you also want to change the query string you have to use a second RewriteRule with [QSA] ... QueryStringAppend ...
mfg
Offline
Thank you all for comments! I'll try your solution soon, mercy (now solving some other things) and let's see then how it works in my case.
Offline
It worked nicely - I have another small problem now - I think page is only partly protected. https - url has red color at the Firefox' address bar and also the lock symbol at the bottom right is red. Would I need something else to add to this rewrite command:
RewriteEngine On
RewriteCond %{QUERY_STRING} .*com_contact.*
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [NC,R,L]
Offline
My new problem is images-related - got to fix the code to use dynamic urls for them like <img src="folder/image.jpg" and not static ones like <img src="http://www.mysite.com/folder/image.jpg".
Offline