Redirect A Single Page To HTTPS Using mod_rewrite


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Options +FollowSymlinks
  2. RewriteEngine on
  3. rewritecond %{http_host} ^example.com [nc]
  4. rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
  5.  
  6. rewritecond %{SERVER_PORT} !^443$
  7. rewriterule ^filename\.php(.*)$ https://www.example.com/filename.php$1 [r=301]

URL: http://www.mcgwebdevelopment.com/blog/2008/01/redirect-only-specific-files-from-http-to-https/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.