See the comments in the .htaccess distributed with the core.<div><div># Various rewrite rules.</div><div><IfModule mod_rewrite.c></div><div> RewriteEngine on</div><div><br></div><div> # If your site can be accessed both with and without the 'www.' prefix, you</div>
<div> # can use one of the following settings to redirect users to your preferred</div><div> # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:</div><div> #</div><div> # To redirect all users to access the site WITH the 'www.' prefix,</div>
<div> # (<a href="http://example.com/.">http://example.com/.</a>.. will be redirected to <a href="http://www.example.com/..">http://www.example.com/..</a>.)</div><div> # adapt and uncomment the following:</div><div> # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]</div>
<div> # RewriteRule ^(.*)$ <a href="http://www.example.com/$1">http://www.example.com/$1</a> [L,R=301]</div><div> #</div><div> # To redirect all users to access the site WITHOUT the 'www.' prefix,</div><div> # (<a href="http://www.example.com/.">http://www.example.com/.</a>.. will be redirected to <a href="http://example.com/..">http://example.com/..</a>.)</div>
<div> # uncomment and adapt the following:</div><div> # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]</div><div> # RewriteRule ^(.*)$ <a href="http://example.com/$1">http://example.com/$1</a> [L,R=301]</div><div><br>
</div><div> # Modify the RewriteBase if you are using Drupal in a subdirectory or in a</div><div> # VirtualDocumentRoot and the rewrite rules are not working properly.</div><div> # For example if your site is at <a href="http://example.com/drupal">http://example.com/drupal</a> uncomment and</div>
<div> # modify the following line:</div><div> # RewriteBase /drupal</div><div> #</div><div> # If your site is running in a VirtualDocumentRoot at <a href="http://example.com/">http://example.com/</a>,</div><div> # uncomment the following line:</div>
<div> # RewriteBase /</div><div><br></div><div> # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.</div><div> RewriteCond %{REQUEST_FILENAME} !-f</div><div> RewriteCond %{REQUEST_FILENAME} !-d</div>
<div> RewriteCond %{REQUEST_URI} !=/favicon.ico</div><div> RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]</div><div></IfModule></div><br><div class="gmail_quote">On Fri, Jul 22, 2011 at 10:17 AM, Shai Gluskin <span dir="ltr"><<a href="mailto:shai@content2zero.com">shai@content2zero.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Lynn,<div><br></div><div>Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.</div>
<div><br></div><div>mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.</div>
<div><br></div><div>I actually think this kind of question might best be handled by the support team at your server company. I'm not saying you shouldn't ask here... but if you don't get a response that helps, that is another route to go.</div>
<div><br></div><div>Shai</div><div><br><div class="gmail_quote"><div><div></div><div class="h5">On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) <span dir="ltr"><<a href="mailto:lynn@stottdesign.com" target="_blank">lynn@stottdesign.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5"><div style="word-wrap:break-word">Can some help with .htaccess? <br><br>How do you redirect all <br>
<a href="https://www.site.com/" target="_blank">https://www.site.com</a> <br>
<a href="http://www.site.com/" target="_blank">http://www.site.com</a> <br><a href="http://site.com/" target="_blank">http://site.com</a><br><br>to<br><br><a href="https://site.com/" target="_blank">https://site.com</a><br>
<br>Thanks,<br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:'Century Gothic';font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:'Century Gothic';font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:'Century Gothic';font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:'Century Gothic';font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div style="word-wrap:break-word">
<br></div></span></div></span></div></span></span></div></div><br></div></div>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br></div>
<br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br></div>