Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) < lynn@stottdesign.com> wrote:
Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
Am I reading the script right?
Using rewrite to redirect to port 80?
From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Shai Gluskin Sent: Friday, July 22, 2011 9:17 AM To: support@drupal.org Subject: Re: [support] https and htaccess
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) lynn@stottdesign.com wrote:
Can some help with .htaccess?
How do you redirect all https://www.site.com https://www.site.com/ http://www.site.com http://www.site.com/ http://site.com http://site.com/
to
https://site.com https://site.com/
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
RewriteCond %{SERVER_PORT} 80 is checking that the current request is coming from port 80, then it redirects to https://
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 11:39 AM, Moshe, Sam wrote:
Am I reading the script right?
Using rewrite to redirect to port 80?
*From:*support-bounces@drupal.org [mailto:support-bounces@drupal.org] *On Behalf Of *Shai Gluskin *Sent:* Friday, July 22, 2011 9:17 AM *To:* support@drupal.org *Subject:* Re: [support] https and htaccess
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) <lynn@stottdesign.com mailto:lynn@stottdesign.com> wrote:
Can some help with .htaccess?
How do you redirect all https://www.site.com https://www.site.com/ http://www.site.com http://www.site.com/ http://site.com http://site.com/
to
https://site.com https://site.com/
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
Yes, Linux, VPS, not shared.
No support on this from my host... on my own with this and I just don't know .htaccess.
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) lynn@stottdesign.com wrote: Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Generic to force everything to ssl:
ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%%7BHTTP_HOST%7D/$1 [NC,R,L]
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 11:52 AM, Lynn Stott (Stott Design) wrote:
Yes, Linux, VPS, not shared.
No support on this from my host... on my own with this and I just don't know .htaccess.
Thanks, Lynn Stott www.stottdesign.com http://www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) <lynn@stottdesign.com mailto:lynn@stottdesign.com> wrote:
Can some help with .htaccess? How do you redirect all https://www.site.com <https://www.site.com/> http://www.site.com <http://www.site.com/> http://site.com <http://site.com/> to https://site.com <https://site.com/> Thanks, -- [ Drupal support list | http://lists.drupal.org/ ]-- [ Drupal support list | http://lists.drupal.org/ ]
This doesn't work.
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 9:56 AM, Jamie Holly wrote:
Generic to force everything to ssl:
ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%%7BHTTP_HOST%7D/$1 [NC,R,L] Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 11:52 AM, Lynn Stott (Stott Design) wrote:
Yes, Linux, VPS, not shared.
No support on this from my host... on my own with this and I just don't know .htaccess.
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) lynn@stottdesign.com wrote: Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Shouldn't have done it from memory LOL. Try this one:
RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://%%7BSERVER_NAME%7D$1 [L,R]
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 12:07 PM, Lynn Stott (Stott Design) wrote:
This doesn't work.
Thanks, Lynn Stott www.stottdesign.com http://www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 9:56 AM, Jamie Holly wrote:
Generic to force everything to ssl:
ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%%7BHTTP_HOST%7D/$1 [NC,R,L] Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 11:52 AM, Lynn Stott (Stott Design) wrote:
Yes, Linux, VPS, not shared.
No support on this from my host... on my own with this and I just don't know .htaccess.
Thanks, Lynn Stott www.stottdesign.com http://www.stottdesign.com/ 208.871.0073
On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) <lynn@stottdesign.com mailto:lynn@stottdesign.com> wrote:
Can some help with .htaccess? How do you redirect all https://www.site.com <https://www.site.com/> http://www.site.com <http://www.site.com/> http://site.com <http://site.com/> to https://site.com <https://site.com/> Thanks, -- [ Drupal support list | http://lists.drupal.org/ ]-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Thanks Jamie for sticking with me!
This works when someone browses without the "www", but doesn't work with www.mysite.com
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 10:32 AM, Jamie Holly wrote:
Shouldn't have done it from memory LOL. Try this one:
RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://%%7BSERVER_NAME%7D$1 [L,R]
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 12:07 PM, Lynn Stott (Stott Design) wrote:
This doesn't work.
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 9:56 AM, Jamie Holly wrote:
Generic to force everything to ssl:
ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%%7BHTTP_HOST%7D/$1 [NC,R,L] Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 11:52 AM, Lynn Stott (Stott Design) wrote:
Yes, Linux, VPS, not shared.
No support on this from my host... on my own with this and I just don't know .htaccess.
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) lynn@stottdesign.com wrote: Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
That sounds like a VHost issue in your SSL configuration. Try adding a:
ServerAlias *.mydomain.com
where you have the configuration for your SSL set (sites-available, httpd.conf, etc..)
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 12:47 PM, Lynn Stott (Stott Design) wrote:
Thanks Jamie for sticking with me!
This works when someone browses without the "www", but doesn't work with www.mysite.com http://www.mysite.com
Thanks, Lynn Stott www.stottdesign.com http://www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 10:32 AM, Jamie Holly wrote:
Shouldn't have done it from memory LOL. Try this one:
RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://%%7BSERVER_NAME%7D$1 [L,R]
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 12:07 PM, Lynn Stott (Stott Design) wrote:
This doesn't work.
Thanks, Lynn Stott www.stottdesign.com http://www.stottdesign.com/ 208.871.0073
On Jul 22, 2011, at 9:56 AM, Jamie Holly wrote:
Generic to force everything to ssl:
ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%%7BHTTP_HOST%7D/$1 [NC,R,L] Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 11:52 AM, Lynn Stott (Stott Design) wrote:
Yes, Linux, VPS, not shared.
No support on this from my host... on my own with this and I just don't know .htaccess.
Thanks, Lynn Stott www.stottdesign.com http://www.stottdesign.com/ 208.871.0073
On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) <lynn@stottdesign.com mailto:lynn@stottdesign.com> wrote:
Can some help with .htaccess? How do you redirect all https://www.site.com <https://www.site.com/> http://www.site.com <http://www.site.com/> http://site.com <http://site.com/> to https://site.com <https://site.com/> Thanks, -- [ Drupal support list | http://lists.drupal.org/ ]-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Do you mean in the .htaccess file?
On Fri, Jul 22, 2011 at 11:33 AM, Jamie Holly hovercrafter@earthlink.netwrote:
** That sounds like a VHost issue in your SSL configuration. Try adding a:
ServerAlias *.mydomain.com
where you have the configuration for your SSL set (sites-available, httpd.conf, etc..)
Jamie Hollyhttp://www.intoxination.net http://www.hollyit.net
On 7/22/2011 12:47 PM, Lynn Stott (Stott Design) wrote:
Thanks Jamie for sticking with me!
This works when someone browses without the "www", but doesn't work with www.mysite.com
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 10:32 AM, Jamie Holly wrote:
Shouldn't have done it from memory LOL. Try this one:
RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://%%7BSERVER_NAME%7D$1 [L,R]
Jamie Hollyhttp://www.intoxination.net http://www.hollyit.net
On 7/22/2011 12:07 PM, Lynn Stott (Stott Design) wrote:
This doesn't work.
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 9:56 AM, Jamie Holly wrote:
Generic to force everything to ssl:
ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%%7BHTTP_HOST%7D/$1 [NC,R,L]
Jamie Hollyhttp://www.intoxination.net http://www.hollyit.net
On 7/22/2011 11:52 AM, Lynn Stott (Stott Design) wrote:
Yes, Linux, VPS, not shared.
No support on this from my host... on my own with this and I just don't know .htaccess.
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) < lynn@stottdesign.com> wrote:
Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Nope - this would be in your Apache configuration file, or one of them. It depends on your distribution and where they set-up the SSL directives.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 2:37 PM, tony maciejowski wrote:
Do you mean in the .htaccess file?
On Fri, Jul 22, 2011 at 11:33 AM, Jamie Holly <hovercrafter@earthlink.net mailto:hovercrafter@earthlink.net> wrote:
That sounds like a VHost issue in your SSL configuration. Try adding a: ServerAlias *.mydomain.com <http://mydomain.com> where you have the configuration for your SSL set (sites-available, httpd.conf, etc..) Jamie Holly http://www.intoxination.net http://www.hollyit.net On 7/22/2011 12:47 PM, Lynn Stott (Stott Design) wrote:Thanks Jamie for sticking with me! This works when someone browses without the "www", but doesn't work with www.mysite.com <http://www.mysite.com> Thanks, Lynn Stott www.stottdesign.com <http://www.stottdesign.com> 208.871.0073 <tel:208.871.0073> On Jul 22, 2011, at 10:32 AM, Jamie Holly wrote:Shouldn't have done it from memory LOL. Try this one: RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://% <https://%/>{SERVER_NAME}$1 [L,R] Jamie Holly http://www.intoxination.net <http://www.intoxination.net/> http://www.hollyit.net <http://www.hollyit.net/> On 7/22/2011 12:07 PM, Lynn Stott (Stott Design) wrote:This doesn't work. Thanks, Lynn Stott www.stottdesign.com <http://www.stottdesign.com/> 208.871.0073 <tel:208.871.0073> On Jul 22, 2011, at 9:56 AM, Jamie Holly wrote:Generic to force everything to ssl: ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://% <https://%/>{HTTP_HOST}/$1 [NC,R,L] Jamie Holly http://www.intoxination.net <http://www.intoxination.net/> http://www.hollyit.net <http://www.hollyit.net/> On 7/22/2011 11:52 AM, Lynn Stott (Stott Design) wrote:Yes, Linux, VPS, not shared. No support on this from my host... on my own with this and I just don't know .htaccess. Thanks, Lynn Stott www.stottdesign.com <http://www.stottdesign.com/> 208.871.0073 <tel:208.871.0073> On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:> Lynn, > > Are you on a Linux server? I think you are talking about > using a mod_rewrite solution which, I think, only works on > Linux. > > mod_rewrite is incredibly powerful and fussy. I wouldn't > risk advising you on the actual script. > > 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. > > Shai > > On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) > <lynn@stottdesign.com mailto:lynn@stottdesign.com> wrote: > > Can some help with .htaccess? > > How do you redirect all > https://www.site.com https://www.site.com/ > http://www.site.com http://www.site.com/ > http://site.com http://site.com/ > > to > > https://site.com https://site.com/ > > Thanks, > > > -- > [ Drupal support list | http://lists.drupal.org/ ] > > > -- > [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]-- [ Drupal support list | http://lists.drupal.org/ ]-- [ Drupal support list | http://lists.drupal.org/ ]
I don't have access to these as I am being hosted on bluehost. I read http://drupal.org/getting-started/clean-urls but the text is outdated:
Location of index.php
For some server configurations, another change to the Drupal .htaccess file may be necessary. Find a line that looks like this, near the end of your Drupal .htaccess file:
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
You may need to replace index.php with the URL path to your Drupal installation's index.php file (only the part after the base URL). For instance, if your site's home page URL is http://example.com/subdir/, you might need to use /subdir/index.php instead of index.php. If your site's home page URL is http://example.com/, you might need to use /index.php instead ofindex.php. This is necessary on some, but not all server configurations.
I don't find that RewriteRule line in my .htaccess. I guess I will go back to the enabling the line <!--<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.tony-mac.com/drupal/">--> at the index.html at my site root. At least that worked.
On Fri, Jul 22, 2
011 at 11:54 AM, Jamie Holly hovercrafter@earthlink.net wrote:
** Nope - this would be in your Apache configuration file, or one of them. It depends on your distribution and where they set-up the SSL directives.
Jamie Hollyhttp://www.intoxination.net http://www.hollyit.net
On 7/22/2011 2:37 PM, tony maciejowski wrote:
Do you mean in the .htaccess file?
On Fri, Jul 22, 2011 at 11:33 AM, Jamie Holly hovercrafter@earthlink.netwrote:
That sounds like a VHost issue in your SSL configuration. Try adding a:
ServerAlias *.mydomain.com
where you have the configuration for your SSL set (sites-available, httpd.conf, etc..)
Jamie Hollyhttp://www.intoxination.net http://www.hollyit.net
On 7/22/2011 12:47 PM, Lynn Stott (Stott Design) wrote:
Thanks Jamie for sticking with me!
This works when someone browses without the "www", but doesn't work with www.mysite.com
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 10:32 AM, Jamie Holly wrote:
Shouldn't have done it from memory LOL. Try this one:
RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://%%7BSERVER_NAME%7D$1 [L,R]
Jamie Hollyhttp://www.intoxination.net http://www.hollyit.net
On 7/22/2011 12:07 PM, Lynn Stott (Stott Design) wrote:
This doesn't work.
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 9:56 AM, Jamie Holly wrote:
Generic to force everything to ssl:
ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%%7BHTTP_HOST%7D/$1 [NC,R,L]
Jamie Hollyhttp://www.intoxination.net http://www.hollyit.net
On 7/22/2011 11:52 AM, Lynn Stott (Stott Design) wrote:
Yes, Linux, VPS, not shared.
No support on this from my host... on my own with this and I just don't know .htaccess.
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) < lynn@stottdesign.com> wrote:
Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
On Sat, 2011-07-23 at 12:11 -0700, tony maciejowski wrote:
I don't have access to these as I am being hosted on bluehost. I read http://drupal.org/getting-started/clean-urls but the text is outdated:
Location of index.php For some server configurations, another change to the Drupal .htaccess file may be necessary. Find a line that looks like this, near the end of your Drupal .htaccess file:
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
You may need to replace index.php with the URL path to your Drupal installation's index.php file (only the part after the base URL). For instance, if your site's home page URL is http://example.com/subdir/, you might need to use /subdir/index.php instead of index.php. If your site's home page URL is http://example.com/, you might need to use /index.php instead of index.php. This is necessary on some, but not all server configurations.
What should be noted about those two are: - drupal files and .htaccess are in different directories on each case - url given to visitor reflects the physical directory - "RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]" match both cases
I don't find that RewriteRule line in my .htaccess.
It changed to "RewriteRule ^ index.php [L]" in D7. I think drupal will fetch the url via php and apply clean-url-parsing there.
I guess I will go back to the enabling the line <!--<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.tony-mac.com/drupal/">--> at the index.html at my site root. At least that worked.
If you want to redirect http://www.tony-mac.com/ to http://www.tony-mac.com/drupal/, i think you need another .htaccess on your root (keep the one in /drupal).
Maybe something like this (untested)
# use <FilesMatch> to purge everything in /, nothing to see here folks
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase /drupal </IfModule>
If RewriteBase not enough, remove that, and throw this instead :3
RewriteRule ^(.*)$ drupal/$1 [L,R=301]
fireh.
Hi,
(I apologize if this comes through twice, the first time didn't show up in the list. This is my first time contributing and maybe I didn't wait long enough or something.)
Two things. First about the www since you may have solved the rest, and then what Apache says about .htaccess. I assume you are using Apache and have a Virtual Private Server hosting account.
1) Do you have something like the following in your httpd.conf file? The first part should take care or you www access problem and the second part changes http requests into https requests.
<VirtualHost *:80> ServerName yourdomain.com ServerAlias www.yourdomain.com DocumentRoot /var/www/html ### next 3 lines change http access to https ### RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.yourdomain.com$1 [R=301,L] </VirtualHost>
2) I would put the above in your httpd.conf file instead of .htaccess. The reason for this is explained in the Apache documentation at http://httpd.apache.org/docs/current/howto/htaccess.html in the *When (not) to use .htaccess files* section. Part is quoted below, but there is more:
"In general, you should never use |.htaccess| files unless you don't have access to the main server configuration file. There is, for example, a prevailing misconception that user authentication should always be done in |.htaccess| files. This is simply not the case. You can put user authentication configurations in the main server configuration, and this is, in fact, the preferred way to do things."
I hope this helps and that I have not misunderstood your problem.
Robert Alter
Lynn Stott (Stott Design) wrote:
Thanks Jamie for sticking with me!
This works when someone browses without the "www", but doesn't work with www.mysite.com http://www.mysite.com
Thanks, Lynn Stott www.stottdesign.com http://www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 10:32 AM, Jamie Holly wrote:
Shouldn't have done it from memory LOL. Try this one:
RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://%%7BSERVER_NAME%7D$1 [L,R]
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 12:07 PM, Lynn Stott (Stott Design) wrote:
This doesn't work.
Thanks, Lynn Stott www.stottdesign.com http://www.stottdesign.com/ 208.871.0073
On Jul 22, 2011, at 9:56 AM, Jamie Holly wrote:
Generic to force everything to ssl:
ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%%7BHTTP_HOST%7D/$1 [NC,R,L] Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 7/22/2011 11:52 AM, Lynn Stott (Stott Design) wrote:
Yes, Linux, VPS, not shared.
No support on this from my host... on my own with this and I just don't know .htaccess.
Thanks, Lynn Stott www.stottdesign.com http://www.stottdesign.com/ 208.871.0073
On Jul 22, 2011, at 8:17 AM, Shai Gluskin wrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) <lynn@stottdesign.com mailto:lynn@stottdesign.com> wrote:
Can some help with .htaccess? How do you redirect all https://www.site.com <https://www.site.com/> http://www.site.com <http://www.site.com/> http://site.com <http://site.com/> to https://site.com <https://site.com/> Thanks, -- [ Drupal support list | http://lists.drupal.org/ ]-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
See the comments in the .htaccess distributed with the core. # Various rewrite rules. <IfModule mod_rewrite.c> RewriteEngine on
# If your site can be accessed both with and without the 'www.' prefix, you # can use one of the following settings to redirect users to your preferred # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: # # To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example.com/.. .) # adapt and uncomment the following: # RewriteCond %{HTTP_HOST} ^example.com$ [NC] # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] # # To redirect all users to access the site WITHOUT the 'www.' prefix, # (http://www.example.com/... will be redirected to http://example.com/.. .) # uncomment and adapt the following: # RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a # VirtualDocumentRoot and the rewrite rules are not working properly. # For example if your site is at http://example.com/drupal uncomment and # modify the following line: # RewriteBase /drupal # # If your site is running in a VirtualDocumentRoot at http://example.com/, # uncomment the following line: # RewriteBase /
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] </IfModule>
On Fri, Jul 22, 2011 at 10:17 AM, Shai Gluskin shai@content2zero.comwrote:
Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) < lynn@stottdesign.com> wrote:
Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
I did.. it doesn't address ssl (https://)
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 9:58 AM, Walt Daniels wrote:
See the comments in the .htaccess distributed with the core. # Various rewrite rules.
<IfModule mod_rewrite.c> RewriteEngine on
# If your site can be accessed both with and without the 'www.' prefix, you # can use one of the following settings to redirect users to your preferred # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: # # To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example.com/...) # adapt and uncomment the following: # RewriteCond %{HTTP_HOST} ^example.com$ [NC] # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] # # To redirect all users to access the site WITHOUT the 'www.' prefix, # (http://www.example.com/... will be redirected to http://example.com/...) # uncomment and adapt the following: # RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a # VirtualDocumentRoot and the rewrite rules are not working properly. # For example if your site is at http://example.com/drupal uncomment and # modify the following line: # RewriteBase /drupal # # If your site is running in a VirtualDocumentRoot at http://example.com/, # uncomment the following line: # RewriteBase /
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
On Fri, Jul 22, 2011 at 10:17 AM, Shai Gluskin shai@content2zero.com wrote: Lynn,
Are you on a Linux server? I think you are talking about using a mod_rewrite solution which, I think, only works on Linux.
mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you on the actual script.
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.
Shai
On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) lynn@stottdesign.com wrote: Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Lynn,
FYI what you "don't know" (it's good to know what you don't know) in terms of implementing this is "mod_rewrite". .htacess is just a good place to put the mod_rewrite... and you know that already. It's mod_rewrite that you need to figure out.
Shai
This thread got me to experimenting. My site is at www.mysite.com/drupal so I uncommented this in .htaccess # Modify the RewriteBase if you are using Drupal in a subdirectory or in a # VirtualDocumentRoot and the rewrite rules are not working properly. # For example if your site is at http://example.com/drupal uncomment and # modify the following line: RewriteBase /drupal
I then tried out both of these possibilities:
# If your site can be accessed both with and without the 'www.' prefix,
you # can use one of the following settings to redirect users to your preferred # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: # # To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example.com/...) # adapt and uncomment the following: # RewriteCond %{HTTP_HOST} ^example.com$ [NC] # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] # # To redirect all users to access the site WITHOUT the 'www.' prefix, # (http://www.example.com/... will be redirected to http://example.com/...) # uncomment and adapt the following: # RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
Now I can access the site with mysite.com and http://www.mysite.com
but *not *with www.mysite.com.
Now, of course, it could be our astaro firewall, which seems probable but just wanted to make sure: The firewall says : Astaro Security Gateway Version 8 http://www.astaro.com Content blockedWhile trying to retrieve the URL: http://www.dsnextgen.com/?a_id=115576&domainname=www.mysite.comhttp://www.dsnextgen.com/?a_id=115576&domainname=www.tony-mac.comThe content is blocked due to the following condition:The URL you have requested is blocked by Surf Protection. If you think this is wrong, please contact your administratorReport:Malicious Sites not allowed.Your cache administrator is: astaro@integrasys-ns.biz
Tony
I think I got it. Both statements are necessary, I think... any comment?
RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://mysite.com/$1 [R,L]
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^ https://%1%%7BREQUEST_URI%7D [L,R=301]
Thanks, Lynn Stott www.stottdesign.com 208.871.0073
On Jul 22, 2011, at 8:10 AM, Lynn Stott (Stott Design) wrote:
Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
Thanks,
On Jul 22, 2011, at 8:10 AM, Lynn Stott (Stott Design) wrote: Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
On Fri, 2011-07-22 at 08:24 -0600, Lynn Stott wrote: I think I got it. Both statements are necessary, I think... any comment?
RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://mysite.com/$1 [R,L]
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^ https://%1%%7BREQUEST_URI%7D [L,R=301]
http://wiki.apache.org/httpd/RewriteHTTPToHTTPS in your .htaccess with mod_rewrite
or
http://wiki.apache.org/httpd/RedirectSSL in your virtual-host-conf with mod_alias(??)
the latest is the recommended one.
actually it's more like RewriteRule ^/?(.*)$ https://mysite.com/$1 [R,L]
with this note about "/?"--that i added--as seen in the first link: # The leading slash is made optional so that this will work either # in httpd.conf or .htaccess context
fireh.