Reputation: 11446
I am attempting to change http to https for an image tag through an .htacess file.
here is the source tag
<img src="http://www.example.org/images/post_images/5879.jpg" width="510" height="315">
I want to change this to:
<img src="https://www.example.org/images/post_images/5879.jpg" width="510" height="315">
here is my .htaccess file what i have accomplished so far:
RewriteRule ^images/(.*) https://example.org/images/$1 [R]
Upvotes: 2
Views: 8856
Reputation: 785098
You can use this code in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^images/.+$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Upvotes: 3