Specific 30x redirect

by Jason   Last Updated August 14, 2019 17:00 PM

How do I do a 30x redirect in htaccess but only for URLs that start with this:

http ://domain.tld/x/anything_here

I want to redirect these to:

httpS ://domain.tld/x/anything_here

I dont want the redirect o affect any other URLs on this domain.

I can do this redirect with php, but my understanding is that if i do it in my .htaccess file, it will be a tiny bit faster as php wont have to be executed. is that correct? Basically, Im trying to do the fastest direct possible.

thank you!

Related Questions

.htaccess 301 redirect remove [] from the URL

Updated August 13, 2018 15:00 PM

how to redirect old html url to new php Url

Updated January 09, 2018 12:00 PM

Sub domain to Sub domain folder without loop error

Updated October 01, 2015 05:00 AM