I only want to redirect my checkout page to https

User Generated

gnlznt

Programming

Question Description

I only want to redirect my checkout page to https. Will the following work?

redirect 301 http://www.patioslingsite.com/products-page/checkout https://www.patioslingsite.com/products-page/checkout


Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Explanation & Answer

Try using .access to redirect.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^http://www.patioslingsite.com/products-page/checkout$ [NC]
RewriteRule ^(.*)$ https://www.patioslingsite.com/products-page/checkout$1 [R=301,L]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Are you using apache? Create a file called .htaccess in your webroot and copy paste the code above.

urael (1070)
UT Austin

Anonymous
Really great stuff, couldn't ask for more.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4