I want to redirect x page to x page but with https, I don't want it to be php'ed because I know how to do it with php but I want it with htaccess how I can redirect only x page to the same page but with https version ?
Thanks. 🙂
RewriteCond %{HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
That's for the whole site not for a specific file Derokorian.
2CODE;10998852 wrote:That's for the whole site not for a specific file Derokorian.
So then change the RewriteRule to match whatever pattern is more appropriate.
Indeed it is, but using your own logic you could change it to something like:
RewriteCond %{REQUEST_URI} /foo/bar/secure\.php$ RewriteCond %{HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
And just like that all requests to http://example.com/foo/bar/secure.php will be redirected to https://example.com/foo/bar/secure.php
Works fine thanks