.htaccess redirect for a form


#1

Hey dear people,

I cannot get an https redirect to work for a user form I set up.

I want to be able to redirect from:
website.com/application-form
to
https://website.com/application-form

Here’s my htaccess, rule is in the last line:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]
RewriteRule ^site/(.*) index.php [L]
RewriteRule ^kirby/(.*) index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) panel/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

RewriteCond %{HTTPS} !=on
RewriteRule ^/?panel/(.*) https://%{SERVER_NAME}/panel/$1 [R]
RewriteRule ^/?application-form https://%{SERVER_NAME}/application-form [R,L]
</IfModule>

At some point it worked for Safari and Chrome but not in Firefox, but I have no idea why and changed the file since then.
The website is located in a subfolder, which is why I set
RewriteBase /
The application-form is obviously just a subfolder of /content.

Thanks in advance for help,
best,
Timon


#2

May I. asked why you only redirect that page and the panel and not force HTTPS on the site?


#3

Okay, well. Fair point. Is there any downside to doing that?

Thanks for the Edit.


#4

No, to the contrary, where is the point of limiting HTTPS to individual pages? You are more likely to run into issues if you do what you were trying to. do.