Re: [fw-general] 301 Redirect

2009-01-18 Thread bits.abhinav

Thanks a lot!
Its working now. 


Simone Carletti wrote:
> 
> Toggle the order of the rules. The www redirect should be placed before
> the Zend Framework rewrite rule. In fact, it should appear first before
> any functional rewrite rule.
> 
> 
> bits.abhinav wrote:
>> 
>> But will this work with the Rewrite rules for Zend Framework?
>> 
>> RewriteEngine on
>> RewriteCond %{REQUEST_FILENAME} !-f
>> RewriteRule .* index.php
>> 
>> I tried adding this code below the above code but it takes me to
>> www.domain.com/index.php which then messes up with the relative URLs in
>> the code.
>> 
>> 
>> Simone Carletti wrote:
>>> 
>>> There is more than one solution for this problem.
>>> Here's one.
>>> 
>>> RewriteEngine On
>>> RewriteCond %{HTTP_HOST} ^domain\.com [NC]
>>> RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]
>>> 
>>> -- Simone
>>> 
>>> 
>>> bits.abhinav wrote:
 
 Hi all,
 I want to implement a 301 redirect on my portal so that domain.com
 redirects to www.domain.com. I don't have much knowledge about the
 mod_rewrite module of Apace. I found out the code for this online but
 it doesn't work properly. If anyone has done this before or knows how
 to do it please help me out.
 
 Thanks
 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21532154.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 Redirect

2009-01-17 Thread Simone Carletti

Toggle the order of the rules. The www redirect should be placed before the
Zend Framework rewrite rule. In fact, it should appear first before any
functional rewrite rule.


bits.abhinav wrote:
> 
> But will this work with the Rewrite rules for Zend Framework?
> 
> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule .* index.php
> 
> I tried adding this code below the above code but it takes me to
> www.domain.com/index.php which then messes up with the relative URLs in
> the code.
> 
> 
> Simone Carletti wrote:
>> 
>> There is more than one solution for this problem.
>> Here's one.
>> 
>> RewriteEngine On
>> RewriteCond %{HTTP_HOST} ^domain\.com [NC]
>> RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]
>> 
>> -- Simone
>> 
>> 
>> bits.abhinav wrote:
>>> 
>>> Hi all,
>>> I want to implement a 301 redirect on my portal so that domain.com
>>> redirects to www.domain.com. I don't have much knowledge about the
>>> mod_rewrite module of Apace. I found out the code for this online but it
>>> doesn't work properly. If anyone has done this before or knows how to do
>>> it please help me out.
>>> 
>>> Thanks
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21515265.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 Redirect

2009-01-17 Thread bits.abhinav

But will this work with the Rewrite rules for Zend Framework?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php

I tried adding this code below the above code but it takes me to
www.domain.com/index.php which then messes up with the relative URLs in the
code.


Simone Carletti wrote:
> 
> There is more than one solution for this problem.
> Here's one.
> 
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^domain\.com [NC]
> RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]
> 
> -- Simone
> 
> 
> bits.abhinav wrote:
>> 
>> Hi all,
>> I want to implement a 301 redirect on my portal so that domain.com
>> redirects to www.domain.com. I don't have much knowledge about the
>> mod_rewrite module of Apace. I found out the code for this online but it
>> doesn't work properly. If anyone has done this before or knows how to do
>> it please help me out.
>> 
>> Thanks
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21515215.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 Redirect

2009-01-17 Thread bits.abhinav

But will this work with the Rewrite rules for Zend Framework?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php

I tried adding this code below the above code but it takes me to
www.domain.com/index.php which then messes up with the relative URLs in the
code.


Simone Carletti wrote:
> 
> There is more than one solution for this problem.
> Here's one.
> 
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^domain\.com [NC]
> RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]
> 
> -- Simone
> 
> 
> bits.abhinav wrote:
>> 
>> Hi all,
>> I want to implement a 301 redirect on my portal so that domain.com
>> redirects to www.domain.com. I don't have much knowledge about the
>> mod_rewrite module of Apace. I found out the code for this online but it
>> doesn't work properly. If anyone has done this before or knows how to do
>> it please help me out.
>> 
>> Thanks
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21515212.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 Redirect

2009-01-17 Thread Simone Carletti

There is more than one solution for this problem.
Here's one.

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

-- Simone


bits.abhinav wrote:
> 
> Hi all,
> I want to implement a 301 redirect on my portal so that domain.com
> redirects to www.domain.com. I don't have much knowledge about the
> mod_rewrite module of Apace. I found out the code for this online but it
> doesn't work properly. If anyone has done this before or knows how to do
> it please help me out.
> 
> Thanks
> 

-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21514713.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] 301 Redirect

2009-01-17 Thread bits.abhinav

Hi all,
I want to implement a 301 redirect on my portal so that domain.com redirects
to www.domain.com. I don't have much knowledge about the mod_rewrite module
of Apace. I found out the code for this online but it doesn't work properly.
If anyone has done this before or knows how to do it please help me out.

Thanks
-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21514435.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 redirect

2008-06-12 Thread Isaak Malik
You're welcome :)

On Thu, Jun 12, 2008 at 7:19 PM, scottlively <[EMAIL PROTECTED]> wrote:

>
> Isaak,
>
> Beautiful!  That's the one.  Thanks so much for your help.
>
> Scott
>
>
> Isaak Malik-3 wrote:
> >
> > Well.. Since more are against my method than for it tweaked your
> .htaccess
> > code a bit:
> >
> > RewriteEngine On
> > RewriteCond %{HTTP_HOST} ^example\.com
> > RewriteRule (.*) http://www.example.com/$1 [R=301,L]
> >
> >
> > On Thu, Jun 12, 2008 at 6:22 PM, Karol Grecki <[EMAIL PROTECTED]> wrote:
> >
> >>
> >> This would send 302, not 301 header
> >>
> >>
> >> Isaak Malik-3 wrote:
> >> >
> >> > Why not just simply use:
> >> >
> >> >  >> >
> >> > if ( !preg_match('/^www\./i', $_SERVER['HTTP_HOST']) )
> >> >header('Location: http://www.example.com');
> >> 
> >> >
> >> > ?>
> >> >
> >> > On Thu, Jun 12, 2008 at 5:40 PM, Scott Lively <[EMAIL PROTECTED]>
> >> wrote:
> >> >
> >> >>  How would you do a 301 redirect like the following?
> >> >>
> >> >>
> >> >>
> >> >> http://example.com to
> >> >>
> >> >> http://www.example.com
> >> >>
> >> >>
> >> >>
> >> >> I've tried adding the following to my .htaccess file:
> >> >>
> >> >>
> >> >>
> >> >> RewriteEngine on
> >> >>
> >> >> rewritecond %{http_host} ^example.com [nc]
> >> >>
> >> >> rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
> >> >>
> >> >>
> >> >>
> >> >> yet I get 400 Bad Request error.
> >> >>
> >> >>
> >> >>
> >> >> Does this need to be done somewhere in the Zend_Controller?
> >> >>
> >> >>
> >> >>
> >> >> Thanks,
> >> >>
> >> >>
> >> >>
> >> >> Scott Lively
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Isaak Malik
> >> > Web Developer
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/301-redirect-tp17803242p17803976.html
> >> Sent from the Zend Framework mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Isaak Malik
> > Web Developer
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/301-redirect-tp17803242p17805225.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
Isaak Malik
Web Developer


Re: [fw-general] 301 redirect

2008-06-12 Thread scottlively

Isaak,

Beautiful!  That's the one.  Thanks so much for your help.

Scott


Isaak Malik-3 wrote:
> 
> Well.. Since more are against my method than for it tweaked your .htaccess
> code a bit:
> 
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^example\.com
> RewriteRule (.*) http://www.example.com/$1 [R=301,L]
> 
> 
> On Thu, Jun 12, 2008 at 6:22 PM, Karol Grecki <[EMAIL PROTECTED]> wrote:
> 
>>
>> This would send 302, not 301 header
>>
>>
>> Isaak Malik-3 wrote:
>> >
>> > Why not just simply use:
>> >
>> > > >
>> > if ( !preg_match('/^www\./i', $_SERVER['HTTP_HOST']) )
>> >header('Location: http://www.example.com');
>> 
>> >
>> > ?>
>> >
>> > On Thu, Jun 12, 2008 at 5:40 PM, Scott Lively <[EMAIL PROTECTED]>
>> wrote:
>> >
>> >>  How would you do a 301 redirect like the following?
>> >>
>> >>
>> >>
>> >> http://example.com to
>> >>
>> >> http://www.example.com
>> >>
>> >>
>> >>
>> >> I've tried adding the following to my .htaccess file:
>> >>
>> >>
>> >>
>> >> RewriteEngine on
>> >>
>> >> rewritecond %{http_host} ^example.com [nc]
>> >>
>> >> rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
>> >>
>> >>
>> >>
>> >> yet I get 400 Bad Request error.
>> >>
>> >>
>> >>
>> >> Does this need to be done somewhere in the Zend_Controller?
>> >>
>> >>
>> >>
>> >> Thanks,
>> >>
>> >>
>> >>
>> >> Scott Lively
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Isaak Malik
>> > Web Developer
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/301-redirect-tp17803242p17803976.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Isaak Malik
> Web Developer
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-redirect-tp17803242p17805225.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 redirect

2008-06-12 Thread Isaak Malik
Well.. Since more are against my method than for it tweaked your .htaccess
code a bit:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]


On Thu, Jun 12, 2008 at 6:22 PM, Karol Grecki <[EMAIL PROTECTED]> wrote:

>
> This would send 302, not 301 header
>
>
> Isaak Malik-3 wrote:
> >
> > Why not just simply use:
> >
> >  >
> > if ( !preg_match('/^www\./i', $_SERVER['HTTP_HOST']) )
> >header('Location: http://www.example.com'); 
> >
> > ?>
> >
> > On Thu, Jun 12, 2008 at 5:40 PM, Scott Lively <[EMAIL PROTECTED]>
> wrote:
> >
> >>  How would you do a 301 redirect like the following?
> >>
> >>
> >>
> >> http://example.com to
> >>
> >> http://www.example.com
> >>
> >>
> >>
> >> I've tried adding the following to my .htaccess file:
> >>
> >>
> >>
> >> RewriteEngine on
> >>
> >> rewritecond %{http_host} ^example.com [nc]
> >>
> >> rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
> >>
> >>
> >>
> >> yet I get 400 Bad Request error.
> >>
> >>
> >>
> >> Does this need to be done somewhere in the Zend_Controller?
> >>
> >>
> >>
> >> Thanks,
> >>
> >>
> >>
> >> Scott Lively
> >>
> >>
> >>
> >
> >
> >
> > --
> > Isaak Malik
> > Web Developer
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/301-redirect-tp17803242p17803976.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
Isaak Malik
Web Developer


Re: [fw-general] 301 redirect

2008-06-12 Thread Pádraic Brady

The ZF rewrite rules will prevent this - have you tried using a custom Router
in the application which if used sets the 301 on the next outgoing response?


scottlively wrote:
> 
> How would you do a 301 redirect like the following?
> 
>  
> 
> http://example.com   to
> 
> http://www.example.com   
> 
>  
> 
> I've tried adding the following to my .htaccess file:
> 
>  
> 
> RewriteEngine on
> 
> rewritecond %{http_host} ^example.com [nc]
> 
> rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc] 
> 
>  
> 
> yet I get 400 Bad Request error.
> 
>  
> 
> Does this need to be done somewhere in the Zend_Controller?
> 
>  
> 
> Thanks,
> 
>  
> 
> Scott Lively
> 
>  
> 
> 
> 


-
Pádraic Brady

http://blog.astrumfutura.com
http://www.patternsforphp.com
OpenID Europe Foundation - Irish Representative
-- 
View this message in context: 
http://www.nabble.com/301-redirect-tp17803242p17804403.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 redirect

2008-06-12 Thread Karol Grecki

This would send 302, not 301 header


Isaak Malik-3 wrote:
> 
> Why not just simply use:
> 
>  
> if ( !preg_match('/^www\./i', $_SERVER['HTTP_HOST']) )
>header('Location: http://www.example.com'); 
> 
> ?>
> 
> On Thu, Jun 12, 2008 at 5:40 PM, Scott Lively <[EMAIL PROTECTED]> wrote:
> 
>>  How would you do a 301 redirect like the following?
>>
>>
>>
>> http://example.com to
>>
>> http://www.example.com
>>
>>
>>
>> I've tried adding the following to my .htaccess file:
>>
>>
>>
>> RewriteEngine on
>>
>> rewritecond %{http_host} ^example.com [nc]
>>
>> rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
>>
>>
>>
>> yet I get 400 Bad Request error.
>>
>>
>>
>> Does this need to be done somewhere in the Zend_Controller?
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Scott Lively
>>
>>
>>
> 
> 
> 
> -- 
> Isaak Malik
> Web Developer
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-redirect-tp17803242p17803976.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 redirect

2008-06-12 Thread Isaak Malik
Why not just simply use:

http://www.example.com'); 

?>

On Thu, Jun 12, 2008 at 5:40 PM, Scott Lively <[EMAIL PROTECTED]> wrote:

>  How would you do a 301 redirect like the following?
>
>
>
> http://example.com to
>
> http://www.example.com
>
>
>
> I've tried adding the following to my .htaccess file:
>
>
>
> RewriteEngine on
>
> rewritecond %{http_host} ^example.com [nc]
>
> rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
>
>
>
> yet I get 400 Bad Request error.
>
>
>
> Does this need to be done somewhere in the Zend_Controller?
>
>
>
> Thanks,
>
>
>
> Scott Lively
>
>
>



-- 
Isaak Malik
Web Developer


[fw-general] 301 redirect

2008-06-12 Thread Scott Lively
How would you do a 301 redirect like the following?

 

http://example.com   to

http://www.example.com   

 

I've tried adding the following to my .htaccess file:

 

RewriteEngine on

rewritecond %{http_host} ^example.com [nc]

rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc] 

 

yet I get 400 Bad Request error.

 

Does this need to be done somewhere in the Zend_Controller?

 

Thanks,

 

Scott Lively

 



Re: [fw-general] 301 redirect

2007-07-17 Thread Nico Edtinger

[17.07.2007 14:50] Dave Lyon wrote:

Wouldn't this work?

header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$new_url);


Since PHP 4.3.0 that's one line: header('Location: ' . $uri, true, 301);
The advantage is, that you don't have to check, which HTTP version  
the client uses.


nico


Re: [fw-general] 301 redirect

2007-07-17 Thread Simon Mundy

The Zend MVC helper is a pretty safe bet:-

http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#id4796449


Wouldn't this work?

header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$new_url);

On Jul 17, 2007, at 5:47 AM, frosty1 wrote:



my client is trying to set up 301 redirects for several highly  
rated pages on
the site we are converting to zf.has anyone had any luck doing  
this?

--
View this message in context: 
http://www.nabble.com/301-redirect-tf4096317s16154.html#a11647661
Sent from the Zend Framework mailing list archive at Nabble.com.






--

Simon Mundy | Director | PEPTOLAB

""" " "" "" "" "" """ " "" " " " "  "" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654  
4124

http://www.peptolab.com



Re: [fw-general] 301 redirect

2007-07-17 Thread till

On 7/17/07, Dave Lyon <[EMAIL PROTECTED]> wrote:

Wouldn't this work?

header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$new_url);


I don't see why it wouldn't!

I just wouldn't want to create all those files, I'd rather let the
webserver handle this.
But maybe that's just me.

Till


Re: [fw-general] 301 redirect

2007-07-17 Thread Dave Lyon

Wouldn't this work?

header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$new_url);

On Jul 17, 2007, at 5:47 AM, frosty1 wrote:



my client is trying to set up 301 redirects for several highly  
rated pages on
the site we are converting to zf.has anyone had any luck doing  
this?

--
View this message in context: http://www.nabble.com/301-redirect- 
tf4096317s16154.html#a11647661

Sent from the Zend Framework mailing list archive at Nabble.com.





Re: [fw-general] 301 redirect

2007-07-17 Thread till

Hi,

On 7/17/07, frosty1 <[EMAIL PROTECTED]> wrote:


my client is trying to set up 301 redirects for several highly rated pages on
the site we are converting to zf.has anyone had any luck doing this?


Depends on the (web)server, on lighttpd I think you should use
mod_redirect (0), which issues a 301 (afaik - last time I checked). On
Apache, you coud use mod_alias (1).

Hope that helps,
Till

0, http://trac.lighttpd.net/trac/wiki/Docs%3AModRedirect
1, http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect


[fw-general] 301 redirect

2007-07-17 Thread frosty1

my client is trying to set up 301 redirects for several highly rated pages on
the site we are converting to zf.has anyone had any luck doing this?
-- 
View this message in context: 
http://www.nabble.com/301-redirect-tf4096317s16154.html#a11647661
Sent from the Zend Framework mailing list archive at Nabble.com.