Help - Search - Members - Calendar
Full Version: Quick .htaccess Help
The Planet Forums > System Administration > Other
markcausa
I am trying to set up the following redirect:
https://domain.com >> https://www.domain.com

QUOTE
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^/?(.*)$ http://www.domain.com/$1 [R=301,L]


That is the .htaccess rule that redirects domain.com to www.domain.com, so how would I modify that to redirect the https portion of things?
doc
Try:



Options +FollowSymlinks
RewriteEngine on
rewritecond %{https_host} ^domain.com [nc]
rewriterule ^(.*)$ https://www.domain.com/$1 [r=301,nc]
markcausa
That didn't do any type of redirecting for some reason. sad.gif
skeeter1jd
When expressions are kicking my butt:

http://www.thepcmanwebsite.com/page_redire...generator.shtml
markcausa
Sweet!

QUOTE
Redirect permanent /https://domain.com https://www.domain.com


That did it, and I bookmarked the link. Thank you both. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.