S
S
suzyry2016-05-10 13:56:24
Apache HTTP Server
suzyry, 2016-05-10 13:56:24

How to set up a redirect from http to https for only one page?

Hello. How to set up a redirect from http to https for only one page (for example: /index.php?route=checkout/quickcheckout ), and from https to http for all others. Thank you very much for your attention!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2016-05-11
@suzyry

your question should be divided into 3
1. how to make a redirect with a get request
2. how to make a redirect from http -> https
3. how to make a single page redirect.

#если урл index.php
RewriteCond %{REQUEST_URI} ^(.*)/index\.php$
# если  есть гет запрос , конструкция по краям это если  он  не один.
RewriteCond %{QUERY_STRING} (^|&)route=checkout/quickcheckout($|&)
#если http
RewriteCond %{HTTP} on
#Перенаправить на 
RewriteRule ^(.*)$ /%{QUERY_STRING}  [R=301,L]

если же тебе требуется изменить гет запрос то тут все просто обрати внимание на экран перед ?
RewriteRule ^(.*)$ /index.php\?route=checkout/quickcheckout  [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question