Hi, I鈥檝e created the cert in my cPanel, and in config changed the site_value to https and it has converted all the old http shortened links to HTTPS in yourls admin panel. But how can I redirect the old http links traffic to HTTPS? I think this option should be included in the default release.
Thanks
Make your webserver do it. (Plenty of similar tutorials available for whatever HTTP server you're using if you do a quick web search.)
RESOLVED:
# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on **//Added this line**
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /yourls-loader.php [L]
</IfModule>
# END YOURLS
<Files 403.shtml>
order allow,deny
allow from all
</Files>
No man, I'm getting 404 No Found error on https links. Could you send the solid solution for this?
we have this issue too
https access got not found
http access working fine
@IMExperts @mgilank : server conf issue, not YOURLS ...
This works for us:

(stupid PASTE CODE does not work right, sorry)
This works for us:
(stupid PASTE CODE does not work right, sorry)
This fixed the same issue for me. Thank you!
<Files ".htaccess">
Order Allow,Deny
Deny from all
</Files>
# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /yourls-loader.php [L]
</IfModule>
# END YOURLS
Pastable now...
Hi all, I've searched all over for this and I really need help. I've tried this above and similar solutions to no avail. My https links are forwarding correctly but my HTTP ones are not and just default to the catch-all address. http://melm.co/scholars/?nocache=1 (doesn't work) https://melm.co/scholars/?nocache=1 (works). Any ideas?
# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteRule ^.*$ /yourls-loader.php [L]
RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END YOURLS
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_HOST} ^melm.co$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteRule ^/?$ https://themelmills.com [R=301,L]
</IfModule>
theMelMills, why is this commented out?
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Without testing it myself, I think it needs to be there...
theMelMills, why is this commented out?
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Without testing it myself, I think it needs to be there...
It was commented out for troubleshooting as it had no effect. It's back in now and still same result. I believe it's treating the HTTP as an unfound short link and going to catch all instead of rewriting any HTTP to go to https and continue as normal. That's my theory. But still not sure how to fix.
# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteRule ^.*$ /yourls-loader.php [L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END YOURLS
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_HOST} ^melm.co$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteRule ^/?$ https://themelmills.com [R=301,L]
</IfModule>