Forum Moderators: phranque
I have a few specific PHP files in a folder, which when visited, the .htaccess file should force https instead of http.
How do I target those 3 specific PHP files?
For another folder, to force https the whole folder, I am using:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} admin
RewriteRule ^(.*)$ [domain.com...] [R,L]
I imagine it will be similar to this, but changed to target just those files?
Please give me a sample of what it would take to target specific PHP files and force it to https.
Thanks.
So, I'd say you found the best way. :)
[added] And do be sure you're sending a 301-Moved Permanently redirect response, and not a 302. Otherwise, the search engiens will never figure out that your SSL pages should always be listed and linked with an https-protocol URL. [/added]
Jim