Quick question - I know this should be very easy to figure out myself, but I keep finding conflicting information when I try to find the solution, and I'm a stickler for doing/learning things the right way.
I want to redirect all www traffic to non-www.
I am using a fresh copy of Cake 2.1.1 - no changes have been made to any of the .htaccess files.
I have always made rewrite rule changes in the /site/.htacess file exclusively.
I don't really know why the /site/app/.htaccess (or for that matter /site/app/webroot/.htaccess) files exist. I can't even dream up a scenario where those files would ever be applied - as long as the /site/.htaccess file exists.
I realized I answered only part of your question. I have done the opposite of what you are asking - redirecting domain.tld -> www.domain.tld (making the www.domain.tld the canonical URL).
The /site/.htaccess file I use contains: <IfModule mod_rewrite.c> RewriteEngine on
On Fri, Apr 13, 2012 at 9:43 AM, kdubya <kenwin...@winanstech.com> wrote: > I have always made rewrite rule changes in the /site/.htacess file > exclusively.
> I don't really know why the /site/app/.htaccess (or for that matter > /site/app/webroot/.htaccess) files exist. I can't even dream up a scenario > where those files would ever be applied - as long as the /site/.htaccess > file exists.
It depends on what the DocumentRoot is set to. Of course, if one has the ability to set it to /path/to/site/app/webroot in the main config then the rewrite rules can be placed there and all .htaccess files removed for better performance.
You may also create another vhost for a catchall for whatever things you might want to redirect there, and give it a 301 to where you do want them to go. I do things like this to force https, or add the www
On Fri, Apr 13, 2012 at 5:29 PM, lowpass <zijn.digi...@gmail.com> wrote: > On Fri, Apr 13, 2012 at 9:43 AM, kdubya <kenwin...@winanstech.com> wrote: > > I have always made rewrite rule changes in the /site/.htacess file > > exclusively.
> > I don't really know why the /site/app/.htaccess (or for that matter > > /site/app/webroot/.htaccess) files exist. I can't even dream up a > scenario > > where those files would ever be applied - as long as the /site/.htaccess > > file exists.
> It depends on what the DocumentRoot is set to. Of course, if one has > the ability to set it to /path/to/site/app/webroot in the main config > then the rewrite rules can be placed there and all .htaccess files > removed for better performance.
> -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions.
> To unsubscribe from this group, send email to > cake-php+unsubscribe@googlegroups.com For more options, visit this group > at http://groups.google.com/group/cake-php
> You may also create another vhost for a catchall for whatever things you > might want to redirect there, and give it a 301 to where you do want them > to go. I do things like this to force https, or add the www
> On Fri, Apr 13, 2012 at 5:29 PM, lowpass <zijn.digi...@gmail.com> wrote:
>> On Fri, Apr 13, 2012 at 9:43 AM, kdubya <kenwin...@winanstech.com> wrote: >> > I have always made rewrite rule changes in the /site/.htacess file >> > exclusively.
>> > I don't really know why the /site/app/.htaccess (or for that matter >> > /site/app/webroot/.htaccess) files exist. I can't even dream up a >> scenario >> > where those files would ever be applied - as long as the /site/.htaccess >> > file exists.
>> It depends on what the DocumentRoot is set to. Of course, if one has >> the ability to set it to /path/to/site/app/webroot in the main config >> then the rewrite rules can be placed there and all .htaccess files >> removed for better performance.
>> -- >> Our newest site for the community: CakePHP Video Tutorials >> http://tv.cakephp.org >> Check out the new CakePHP Questions site http://ask.cakephp.org and help >> others with their CakePHP related questions.
>> To unsubscribe from this group, send email to >> cake-php+unsubscribe@googlegroups.com For more options, visit this group >> at http://groups.google.com/group/cake-php
> -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions.
> To unsubscribe from this group, send email to > cake-php+unsubscribe@googlegroups.com For more options, visit this group > at http://groups.google.com/group/cake-php
@kdubya: thats actually how you normally do it anyway what kdubya wants is just not how it is done... (you always use www as the actual site and 301 redirect from non-www there) imo
Am Freitag, 13. April 2012 15:51:52 UTC+2 schrieb kdubya:
> I realized I answered only part of your question. I have done the opposite > of what you are asking - redirecting domain.tld -> www.domain.tld (making > the www.domain.tld the canonical URL).
> The /site/.htaccess file I use contains: > <IfModule mod_rewrite.c> > RewriteEngine on
On Fri, Apr 13, 2012 at 9:37 PM, euromark <dereurom...@googlemail.com> wrote: > @kdubya: thats actually how you normally do it anyway > what kdubya wants is just not how it is done... (you always use www as the > actual site and 301 redirect from non-www there) imo
> Am Freitag, 13. April 2012 15:51:52 UTC+2 schrieb kdubya:
>> I realized I answered only part of your question. I have done the opposite >> of what you are asking - redirecting domain.tld -> www.domain.tld (making >> the www.domain.tld the canonical URL).
>> The /site/.htaccess file I use contains: >> <IfModule mod_rewrite.c> >> RewriteEngine on
> -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions.
> To unsubscribe from this group, send email to > cake-php+unsubscribe@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php
On Friday, April 13, 2012 8:37:46 PM UTC-5, euromark wrote:
> @kdubya: thats actually how you normally do it anyway > what kdubya wants is just not how it is done... (you always use www as the > actual site and 301 redirect from non-www there) imo
> Am Freitag, 13. April 2012 15:51:52 UTC+2 schrieb kdubya:
>> I realized I answered only part of your question. I have done the >> opposite of what you are asking - redirecting domain.tld -> www.domain.tld >> (making the www.domain.tld the canonical URL).
>> The /site/.htaccess file I use contains: >> <IfModule mod_rewrite.c> >> RewriteEngine on
> On Friday, April 13, 2012 8:37:46 PM UTC-5, euromark wrote:
>> @kdubya: thats actually how you normally do it anyway >> what kdubya wants is just not how it is done... (you always use www as >> the actual site and 301 redirect from non-www there) imo
>> Am Freitag, 13. April 2012 15:51:52 UTC+2 schrieb kdubya:
>>> I realized I answered only part of your question. I have done the >>> opposite of what you are asking - redirecting domain.tld -> www.domain.tld >>> (making the www.domain.tld the canonical URL).
>>> The /site/.htaccess file I use contains: >>> <IfModule mod_rewrite.c> >>> RewriteEngine on
>> On Friday, April 13, 2012 8:37:46 PM UTC-5, euromark wrote:
>>> @kdubya: thats actually how you normally do it anyway >>> what kdubya wants is just not how it is done... (you always use www as >>> the actual site and 301 redirect from non-www there) imo
>>> Am Freitag, 13. April 2012 15:51:52 UTC+2 schrieb kdubya:
>>>> I realized I answered only part of your question. I have done the >>>> opposite of what you are asking - redirecting domain.tld -> www.domain.tld >>>> (making the www.domain.tld the canonical URL).
>>>> The /site/.htaccess file I use contains: >>>> <IfModule mod_rewrite.c> >>>> RewriteEngine on
On Sat, Apr 14, 2012 at 2:19 PM, creat1v1ty <justin.r.ran...@gmail.com> wrote: > cool, thanks euromark. Will you please confirm which .htaccess file this > should go in, based on my doc root being public_html...