HighDots Forums  

301 redirect

Search Engine Optimization Discussion about SEO/Search Engine Optimization (alt.internet.search-engines)


Discuss 301 redirect in the Search Engine Optimization forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sergey
 
Posts: n/a

Default 301 redirect - 06-03-2006 , 04:08 PM






Hi,

I wanted to 301 redirect my non www domain to www.domain,
I read that I have to insert the following lines to my .htaccess file.

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

But I do not have acces to .htaccess file and I asked my host support
to do that,

They response is below:

We have redirected configure-all.com/ to www.configure-all.com/ .
We have added the following lines in .htaccess file.
+++++++++++++
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
+++++++++++++

Could some one please confirm that it is correct?
When I type http://configure-all.com in URL it changes to
www.configure-all.com but still
I have doubt.

Thank you


Reply With Quote
  #2  
Old   
Benjamin Niemann
 
Posts: n/a

Default Re: 301 redirect - 06-03-2006 , 04:27 PM






sergey wrote:

Quote:
I wanted to 301 redirect my non www domain to www.domain,
I read that I have to insert the following lines to my .htaccess file.

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

But I do not have acces to .htaccess file
Why not? It's just an ordinary file in your www root. Don't you have write
access to you index.html either?

Quote:
and I asked my host support
to do that,

They response is below:

We have redirected configure-all.com/ to www.configure-all.com/ .
We have added the following lines in .htaccess file.
+++++++++++++
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
+++++++++++++

Could some one please confirm that it is correct?
When I type http://configure-all.com in URL it changes to
www.configure-all.com but still
I have doubt.
It's not exactly the same as your version. If you should have subdomains,
than subdomain.example.com will be redirected to www.subdomain.example.com
(because it matches every hostname not starting with www and prepends a www
to it), which may not be what you intended.
My guess is that they use this code, because it works for any domain, so
they can just copy&paste it without manual modi-(or falsi-)fication.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/


Reply With Quote
  #3  
Old   
FelixDEhuiskater
 
Posts: n/a

Default Re: 301 redirect - 06-03-2006 , 04:52 PM




sergey schreef:

Quote:
Hi,

I wanted to 301 redirect my non www domain to www.domain,
I read that I have to insert the following lines to my .htaccess file.

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

But I do not have acces to .htaccess file and I asked my host support
to do that,

They response is below:

We have redirected configure-all.com/ to www.configure-all.com/ .
We have added the following lines in .htaccess file.
+++++++++++++
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
+++++++++++++
RewriteEngine on
RewriteCond %{HTTP_HOST} ^configure-all.com$
RewriteRule http://www.configure-all.com/$1 [L,R=301]

Maybe your version works also but at the end of the second line there
must be a $ sign i think.

But i can be wrong

Quote:
Could some one please confirm that it is correct?
When I type http://configure-all.com in URL it changes to
www.configure-all.com but still
I have doubt.

Thank you


Reply With Quote
  #4  
Old   
Borek
 
Posts: n/a

Default Re: 301 redirect - 06-03-2006 , 05:08 PM



On Sat, 03 Jun 2006 22:52:45 +0200, FelixDEhuiskater
<pascal.beyens (AT) gmail (DOT) com> wrote:

Quote:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
Condition: if HTTP_HOST doesn't start with www

Quote:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^configure-all.com$
RewriteRule http://www.configure-all.com/$1 [L,R=301]
Condition: if HTTP_HOST equals configure-all.com

Looks like these are (almost) equivalent. First version will work also for
subdomain.example.com (will redirect to www.subdomain.example.com) -
second version will fail (will not redirect).

But I can be wrong as well.

Best,
Borek
--
http://www.chembuddy.com
http://www.ph-meter.info/pH-Nernst-equation
http://www.terapia-kregoslupa.waw.pl


Reply With Quote
  #5  
Old   
John Bokma
 
Posts: n/a

Default Re: 301 redirect - 06-03-2006 , 05:26 PM



"sergey" <sskudaev (AT) yahoo (DOT) com> wrote:

Quote:
Hi,

I wanted to 301 redirect my non www domain to www.domain,
I read that I have to insert the following lines to my .htaccess file.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
As I have said many times before, better is:

http://johnbokma.com/mexit/2004/04/1...forgoogle.html


Quote:
But I do not have acces to .htaccess file and I asked my host support
to do that,

They response is below:

We have redirected configure-all.com/ to www.configure-all.com/ .
We have added the following lines in .htaccess file.
Dumb. They should have added it to httpd.conf. Maybe that was what they
are talking about though.

Quote:
+++++++++++++
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
+++++++++++++

Could some one please confirm that it is correct?
When I type http://configure-all.com in URL it changes to
www.configure-all.com but still
I have doubt.
What is correct? I think it can be done better.

http://ww .configure-all.com/ (remove the space)

doesn't work.

http://ww.johnbokma.com/

does

And yes, some people make those typos :-)

--
John Freelance Perl programmer: http://castleamber.com/

A better start menu with Quick Launch:
http://johnbokma.com/windows/quick-launch.html


Reply With Quote
  #6  
Old   
John Bokma
 
Posts: n/a

Default Re: 301 redirect - 06-03-2006 , 05:29 PM



"FelixDEhuiskater" <pascal.beyens (AT) gmail (DOT) com> wrote:

Quote:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^configure-all.com$
RewriteRule http://www.configure-all.com/$1 [L,R=301]

Maybe your version works also but at the end of the second line there
must be a $ sign i think.

But i can be wrong
Best is to make the Cond: if not equals. Have been posted many times on
this subject before, see:
http://johnbokma.com/mexit/2004/04/1...forgoogle.html

for example with explanation.

--
John Freelance Perl programmer: http://castleamber.com/

Firefox Fast Search:http://johnbokma.com/firefox/keymarks-explained.html


Reply With Quote
  #7  
Old   
Big Bill
 
Posts: n/a

Default Re: 301 redirect - 06-03-2006 , 06:23 PM



On 3 Jun 2006 13:08:24 -0700, "sergey" <sskudaev (AT) yahoo (DOT) com> wrote:

Quote:
Hi,

I wanted to 301 redirect my non www domain to www.domain,
I read that I have to insert the following lines to my .htaccess file.

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

But I do not have acces to .htaccess file and I asked my host support
to do that,

They response is below:

We have redirected configure-all.com/ to www.configure-all.com/ .
We have added the following lines in .htaccess file.
+++++++++++++
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
+++++++++++++

Could some one please confirm that it is correct?
When I type http://configure-all.com in URL it changes to
www.configure-all.com but still
I have doubt.

Thank you
Erm... seems fine to me. If it does what it says on the tin, I
wouldn't worry.

BB
--

http://www.kruse.co.uk/seo-services.htm
http://www.here-be-posters.co.uk/lempicka-prints.htm
http://www.crystal-liaison.com/armani/index.html



Reply With Quote
  #8  
Old   
Big Bill
 
Posts: n/a

Default Re: 301 redirect - 06-03-2006 , 06:23 PM



On Sat, 03 Jun 2006 23:08:30 +0200, Borek
<m.borkowski (AT) delete (DOT) chembuddy.these.com.parts> wrote:

Quote:
On Sat, 03 Jun 2006 22:52:45 +0200, FelixDEhuiskater
pascal.beyens (AT) gmail (DOT) com> wrote:

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

Condition: if HTTP_HOST doesn't start with www

RewriteEngine on
RewriteCond %{HTTP_HOST} ^configure-all.com$
RewriteRule http://www.configure-all.com/$1 [L,R=301]

Condition: if HTTP_HOST equals configure-all.com

Looks like these are (almost) equivalent. First version will work also for
subdomain.example.com (will redirect to www.subdomain.example.com) -
second version will fail (will not redirect).

But I can be wrong as well.

Best,
Borek
Perhaps now the OP will begin to understand why if something technical
works I don't question it too much.
More seriously, web hosts have to know this kind of stuff more and
more these days and frankly not all of them do. It's getting a lot
tougher to run a web server properly and I suspect the easy days for
the casual reseller are pretty much done.

BB
--

http://www.kruse.co.uk/seo-services.htm
http://www.here-be-posters.co.uk/lempicka-prints.htm
http://www.crystal-liaison.com/armani/index.html



Reply With Quote
  #9  
Old   
sergey
 
Posts: n/a

Default Re: 301 redirect - 06-04-2006 , 10:03 AM




Thanks to All

sergey


Reply With Quote
  #10  
Old   
FelixDEhuiskater
 
Posts: n/a

Default Re: 301 redirect - 06-04-2006 , 11:57 AM




John Bokma schreef:

Quote:
"FelixDEhuiskater" <pascal.beyens (AT) gmail (DOT) com> wrote:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^configure-all.com$
RewriteRule http://www.configure-all.com/$1 [L,R=301]

Maybe your version works also but at the end of the second line there
must be a $ sign i think.

But i can be wrong

Best is to make the Cond: if not equals. Have been posted many times on
this subject before, see:
http://johnbokma.com/mexit/2004/04/1...forgoogle.html

for example with explanation.
yep this is better, i only wanted the non www to the www for SE's.

1 question :
RewriteCond %{HTTP_HOST} !^www\.domain\.xx$

the first dot also have to be escaped like i did?(and no escape in the
rewriterule?)

Quote:
--
John Freelance Perl programmer: http://castleamber.com/

Firefox Fast Search:http://johnbokma.com/firefox/keymarks-explained.html


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.