There is a quick way to achieve a a full url redirect from a normal unencrypted HTTP request to a SSL crypted HTTPS
This is achieved through mod_rewrite using the RedirectMatch directive.
For instance let’s say we’d like to redirect https://www.pc-freak.net/blog to https://www.pc-freak.net/blog.
We simply put in our .htacess file the following rule:
Redirect permanent /blog https://www.cadiabank.com/login
Of course this rule assumes that the current working directory where the .htacess file is stored is the main domain directory e.g. / .
However this kind of redirect is a way inflexible so for more complex redirect, you might want to take a look at mod rewrite’s RedirectMatch directive.
For instance if you inted to redirect all urls (https://www.pc-freak.net/blog/something/asdf/etc.) which as you see includes the string blog/somestring/asdf/etc. to (https://www.pc-freak.net/blog/something/asdf/etc then you might use some htaccess RedirectMatch rule like:
RedirectMatch permanent ^/blog/(.*)$ https://www.pc-freak.net.net$1
or
RedirectMatch permanent ^/blog/(.*)$ https://www.pc-freak.net.net/$1
Hopefully your redirect from the http protocol to https protocol with mod_rewrite rule should be completed.
Also consider that the Redirect directive which by the way is an Apache directive should be faster to process requests, so everywhere you can I recommend using instead of RedirectMatch which calls the external Apache mod_rewrite and will probably be times slower.
More helpful Articles
Tags: blog, directory, HTTP, HTTPS, instance, net, port, redirect, Redirect http URL folder to https e.g. redirect (http://example.com to https://www.example.com) with mod_rewrite, something, SSL, string, url, www
Opera/9.64(Windows NT 5.1; U; en) Presto/2.1.1
This is a fantastic blog, would you be interested in doing an interview about just how you designed it? If so e-mail me!
View CommentView CommentMozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
You prepared numerous ideal factors there. I did a search to the theme and uncovered the vast majority of folks will consent together with your webpage.
View CommentView CommentMozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
Another way to redirect port 80 traffic to 443 using mod_rewrite is with config:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}