Discussion on fix-canonical-issues-www-vs-non-www-and-more-on-apache-server

64 views
Skip to first unread message

speculumcm

unread,
Jul 24, 2008, 3:36:19 PM7/24/08
to Only Validation + Navigation = Crawlability
Hello Webado,

Thank you for all your info. Now I have some doubts in regards of
addonDomains. I've seen issues with http://mainDomain.com/addonDomain
could be indexed.
I tried in my .htaccess mainDomain root this directive but didn't wok

RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^addonDomain/?$ http://www.addonDomain.com/ [R=301,L]

Do you know what should I do?

Regards,

webado

unread,
Jul 24, 2008, 3:51:14 PM7/24/08
to Only Validation + Navigation = Crawlability
You are approaching it from the wrong end.

The physical root folder of the addon domain is in this folder of the
main domain at http://mainDomain.com/addonDomain/ .
So the .htaccess file which can affect that should be located in that
folder.


RewriteCond %{http_host} !^www.addondomain.com [nc]
RewriteRule ^(.*)$ http://www.addondomain..com/$1 [r=301,nc,L]


You don't attempt tp manage that from the root of the main domain.



On Jul 24, 3:36 pm, speculumcm <speculu...@gmail.com> wrote:
> Hello Webado,
>
> Thank you for all your info. Now I have some doubts in regards of
> addonDomains. I've seen issues withhttp://mainDomain.com/addonDomain
> could be indexed.
> I tried in my .htaccess mainDomain root this directive but didn't wok
>
> RewriteEngine on
> RewriteCond %{HTTP_HOST} ^.*$
> RewriteRule ^addonDomain/?$http://www.addonDomain.com/[R=301,L]

speculumcm

unread,
Jul 24, 2008, 4:13:26 PM7/24/08
to Only Validation + Navigation = Crawlability
Thank you very much for your quick reply,

I did what you suggested and got a 404 error. Hmmm well that's better
but in the browser get this:

http://www.addonDomain.com//home/name/public_html/addonDomain

At least that one can't be indexed :) Though do you think I made a
mistake in some of my directives that can cause that. This is my
htaccess file:

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

### re-direct non-www to www
rewritecond %{http_host} ^addonDomain.com.mx [nc]
rewriterule ^(.*)$ http://www.addonDomain.com.mx/$1 [r=301,nc]

## re-direct mainDomain.com/addonDomain to www.addonDomain.com.mx
RewriteCond %{http_host} !^www.addonDomain.com.mx [nc]
RewriteRule ^(.*)$ http://www.addonDomain.com.mx/$1 [r=301,nc,L]

### re-direct addonDomain.mainDomain.com to www.addonDomain.com.mx
rewritecond %{http_host} ^addonDomain.mainDomain.com [nc]
rewriterule ^(.*)$ http://www.addonDomain.com.mx/$1 [r=301,nc]

### re-direct addonDomain.mainDomain.com to www.addonDomain.com.mx
rewritecond %{http_host} ^www.addonDomain.mainDomain.com [nc]
rewriterule ^(.*)$ http://www.addonDomain.com.mx/$1 [r=301,nc]

#### re-direct error 404
ErrorDocument 404 /error404.php

</Ifmodule>


On Jul 24, 2:51 pm, webado <web...@gmail.com> wrote:
> You are approaching it from the wrong end.
>
> The physical root folder of the addon domain is in this folder of the
> main domain  athttp://mainDomain.com/addonDomain/ .
> So the .htaccess file which can affect that should  be located in that
> folder.
>
> RewriteCond %{http_host} !^www.addondomain.com[nc]
> RewriteRule ^(.*)$http://www.addondomain..com/$1[r=301,nc,L]

webado

unread,
Jul 24, 2008, 4:28:04 PM7/24/08
to only-va...@googlegroups.com
 
You cannot get a 404 - lol - unless you used what I gave you literally LOL
 
You need to use proper domain name and addon domain name and so on.
--
www.webado.net
Webhosting and Design

speculumcm

unread,
Jul 24, 2008, 4:36:04 PM7/24/08
to Only Validation + Navigation = Crawlability
Lol, yeah you're right,
I need to have a proper domain and I do have them it was just that I
wanted to be more general since I have many addonDomains :)

Anyway look by yourself one of my real .htaccess files:

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

### re-direct non-www to www
rewritecond %{http_host} ^comaiz.com.mx [nc]
rewriterule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc]

## re-direct desarrollowebdequeretaro.com/comaiz to www.comaiz.com.mx
RewriteCond %{http_host} !^www.comaiz.com.mx [nc]
RewriteRule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc,L]

### re-direct comaiz.desarrollowebdequeretaro.com to www.comaiz.com.mx
rewritecond %{http_host} ^comaiz.desarrollowebdequeretaro.com [nc]
rewriterule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc]

### re-direct comaiz.desarrollowebdequeretaro.com to www.comaiz.com.mx
rewritecond %{http_host} ^www.comaiz.desarrollowebdequeretaro.com [nc]
rewriterule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc]

#### re-direct error 404
ErrorDocument 404 /error404.php

</Ifmodule>

If you write desarrollowebdequeretaro.com/comaiz what do you get?

Right! A 404 page :)


On Jul 24, 3:28 pm, webado <web...@gmail.com> wrote:
> You cannot get a 404 - lol - unless you used what I gave you literally LOL
>
> You need to use proper domain name and addon domain name and so on.
>
> On 7/24/08, speculumcm <speculu...@gmail.com> wrote:
>
>
>
>
>
> > Thank you very much for your quick reply,
>
> > I did what you suggested and got a 404 error. Hmmm well that's better
> > but in the browser get this:
>
> >http://www.addonDomain.com//home/name/public_html/addonDomain
>
> > At least that one can't be indexed :) Though do you think I made a
> > mistake in some of my directives that can cause that. This is my
> > htaccess file:
>
> > <Ifmodule mod_rewrite.c>
> > Options +Indexes +FollowSymlinks
> > RewriteEngine on
> > RewriteBase /
>
> > ### re-direct index.php to root / ###
> > RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
> > RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
>
> > ### re-direct non-www to www
> > rewritecond %{http_host} ^addonDomain.com.mx [nc]
> > rewriterule ^(.*)$http://www.addonDomain.com.mx/$1[r=301,nc]
>
> > ## re-direct mainDomain.com/addonDomain towww.addonDomain.com.mx
> > RewriteCond %{http_host} !^www.addonDomain.com.mx[nc]
> > RewriteRule ^(.*)$http://www.addonDomain.com.mx/$1[r=301,nc,L]
>
> > ### re-direct addonDomain.mainDomain.com towww.addonDomain.com.mx
> > rewritecond %{http_host} ^addonDomain.mainDomain.com [nc]
> > rewriterule ^(.*)$http://www.addonDomain.com.mx/$1[r=301,nc]
>
> > ### re-direct addonDomain.mainDomain.com towww.addonDomain.com.mx
> > rewritecond %{http_host} ^www.addonDomain.mainDomain.com[nc]
> > rewriterule ^(.*)$http://www.addonDomain.com.mx/$1[r=301,nc]

webado

unread,
Jul 24, 2008, 7:04:26 PM7/24/08
to Only Validation + Navigation = Crawlability

Ouch!

First of all this:

### re-direct non-www to www
rewritecond %{http_host} ^comaiz.com.mx [nc]
rewriterule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc]


and this

## re-direct desarrollowebdequeretaro.com/comaiz to www.comaiz.com.mx
RewriteCond %{http_host} !^www.comaiz.com.mx [nc]
RewriteRule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc,L]


do the same thing so use one or the other but not both in teh
saem .htaccess file. The second one is more general in that it will
301 redirect ANYTHING that is NOT on www.comaiz.com.mx to www.comainz.mx
.
No good if the same root folder is shared among many parked domains,
then you should use the more specific one you have above.


But let's deal with your specific case the way I see it.

desarrollowebdequeretaro.com/comaiz hangs as it keeps trying to
redirect probably. In fact:

http://oyoy.eu/page/headers/?full=1&url=http%3a%2f%2fdesarrollowebdequeretaro.com%2fcomaiz


shows a messy situaiton where it gets 301 redirected to:

http://www.comaiz.com.mx//home/desar1/public_html/comaiz


which is very strange and quite wrong. The fodler public_html should
never appear in any address. How did you manage that?


So why don't you remove all those directives in the .htaccess file and
let's startt again.

What is the actual structure of the hosting account? There shoould be
one main domain and a number of add-on domains.

Is each add-on domain mapped to its own folder in the main domain?

Can we say that desarrollowebdequeretaro.com is the main domain and
one of the add-on domains is comaiz.com.mx ?

And this add-on domain sits in a subfolder at
desarrollowebdequeretaro.com/comaiz/ ?


Ok, then you should have one .htaccess file in the root of
desarrollowebdequeretaro.com/ that takes care of this domain's own
canonical form redirection and it's own error page which also has to
be located in this root folder:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /


### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]


### re-direct non-www to www
rewritecond %{http_host} ^desarrollowebdequeretaro.com[nc]
rewriterule ^(.*)$ http://www.desarrollowebdequeretaro.com/$1
[r=301,nc]

</Ifmodule>

ErrorDocument 404 /error404.php

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Now for the add-on domain comaiz.com.mx :

So in the subfolder /comaiz/ where the add-on domain is located you
will have another .htaccess file dealing with this add-on domain. It
will also deal with the situation where somebody wants to access
desarrollowebdequeretaro.com/comaiz/ (whether with or without www, no
matterr) and then will get redirected to the www.comaiz.com.mx as
well. The error page mentioned here will have to sit in this folder,
it is not the same as the one in the main domain root folder:


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /


### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]



### re-direct non-www to www
rewritecond %{http_host} !^www.comaiz.com.mx [nc]
rewriterule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc]

</Ifmodule>

ErrorDocument 404 /error404.php

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Resist the temptation to reuse the same error page by giving it a
fully qualified url - thsi is wrong and resutls in 302's rather than
404. Each add-on domain with its own error page. Make copies,
whatever.




Watch out, currently you have a mess for comaiz.com.mx - it gets badly
redirected to a nonsense place.

http://oyoy.eu/page/headers/?full=1&url=http%3a%2f%2fcomaiz.com.mx%2f




Fix your 2 .htaccess files as I said and you will be OK. Note that I
gave a simplified redirection to root of index.php . It should work.
If it doesn't then the other one should also work.

For all other add-on domains you use the same technique as for
comaiz.com.mx, in their respective folders and for their respective
domain names.



Hope it helps.


On Jul 24, 4:36 pm, speculumcm <speculu...@gmail.com> wrote:
> Lol, yeah you're right,
> I need to have a proper domain and I do have them it was just that I
> wanted to be more general since I have many addonDomains :)
>
> Anyway look by yourself one of my real .htaccess files:
>
> <Ifmodule mod_rewrite.c>
> Options +Indexes +FollowSymlinks
> RewriteEngine on
> RewriteBase /
>
> ### re-direct index.php to root / ###
> RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
> RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
>
> ### re-direct non-www to www
> rewritecond %{http_host} ^comaiz.com.mx [nc]
> rewriterule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc]
>
> ## re-direct desarrollowebdequeretaro.com/comaiz towww.comaiz.com.mx
> RewriteCond %{http_host} !^www.comaiz.com.mx[nc]
> RewriteRule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc,L]
> rewriterule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc]
> rewriterule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc]
> > Webhosting and Design- Hide quoted text -
>
> - Show quoted text -

speculumcm

unread,
Jul 25, 2008, 9:39:39 AM7/25/08
to Only Validation + Navigation = Crawlability
Hello Webado,

First of all, thank you a million for all the time you're taking in
this issue.

Answering your questions:

"The fodler public_html should never appear in any address. How did
you manage that?"

I don't know, I just wrote the redirections as you saw in my post :(

"Why don't you remove all those directives in the .htaccess file and
let's startt again."

OK, I'll do that.

"What is the actual structure of the hosting account? There shoould be
one main domain and a number of add-on domains.
Is each add-on domain mapped to its own folder in the main domain?"

Yes, that is how it is.

"Can we say that desarrollowebdequeretaro.com is the main domain and
one of the add-on domains is comaiz.com.mx ?"

Exactly like that, my mainDomain is desarrollowebdequeretaro.com (a
long name for a domain I know, but in spanish all the words are large :
( )

"And this add-on domain sits in a subfolder at
desarrollowebdequeretaro.com/comaiz/ ? "
Hmmm. I think there is the problem. When I set my add-on's domain from
cPanel automatically creates subfolder in the public_html folder so I
think like desarrollowebdequeretaro.com/public_html/comaiz/. Though
how could I create a subfolder in the way you describe? I think it's
the way how the webhosting company set it.

"Ok, then you should have one .htaccess file in the root of
desarrollowebdequeretaro.com/ that takes care of this domain's own
canonical form redirection and it's own error page which also has to
be located in this root folder:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

### re-direct non-www to www
rewritecond %{http_host} ^desarrollowebdequeretaro.com[nc]
rewriterule ^(.*)$ http://www.desarrollowebdequeretaro.com/$1
[r=301,nc]

</Ifmodule>

ErrorDocument 404 /error404.php
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "

Set it just as you describe but re-direct non-www to www it's not
working :(

"Now for the add-on domain comaiz.com.mx

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

### re-direct non-www to www
rewritecond %{http_host} !^www.comaiz.com.mx [nc]
rewriterule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc]

</Ifmodule>

ErrorDocument 404 /error404.php
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "

Yup, I set it like that with it's own error page. Everything works
fine except for desarrollowebdequeretaro.com/comaiz/ that's still
showing a messy situaiton where it gets 301 redirected to:
http://www.comaiz.com.mx//home/desar1/public_html/comaiz

Do you think there's something I could do to solve this situation?

Again thank you very much for all your help :)

Regards,

speculumcm


On 24 jul, 18:04, webado <web...@gmail.com> wrote:
> Ouch!
>
> First of all this:
>
> ### re-direct non-www to www
> rewritecond %{http_host} ^comaiz.com.mx [nc]
> rewriterule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc]
>
> and this
>
> ## re-direct desarrollowebdequeretaro.com/comaiz towww.comaiz.com.mx
> RewriteCond %{http_host} !^www.comaiz.com.mx[nc]
> RewriteRule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc,L]
>
> do the same thing so use one or the other but not both in teh
> saem .htaccess file. The second one is more general in that it will
> 301 redirect ANYTHING that is NOT onwww.comaiz.com.mxtowww.comainz.mx
> .
> No good if the same root folder is shared among many parked domains,
> then you should use the more specific one you have above.
>
> But let's deal with your  specific case the way I see it.
>
> desarrollowebdequeretaro.com/comaiz hangs as it keeps trying to
> redirect probably. In fact:
>
> http://oyoy.eu/page/headers/?full=1&url=http%3a%2f%2fdesarrollowebdeq...
> rewriterule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> [r=301,nc]
>
> </Ifmodule>
>
> ErrorDocument 404 /error404.php
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Now for the add-on domain comaiz.com.mx :
>
> So in the subfolder /comaiz/ where the add-on domain is located you
> will have another .htaccess file dealing with this add-on domain. It
> will also deal with the situation where somebody wants to access
> desarrollowebdequeretaro.com/comaiz/ (whether with or without www, no
> matterr)  and then will get redirected to thewww.comaiz.com.mxas
> well. The error page mentioned here will have to sit in this folder,
> it is not the same as the one in the main domain root folder:
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> <Ifmodule mod_rewrite.c>
> Options +Indexes +FollowSymlinks
> RewriteEngine on
> RewriteBase /
>
> ### re-direct index.php to root / ###
> RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
> RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
>
> ### re-direct non-www to www
> rewritecond %{http_host} !^www.comaiz.com.mx[nc]
> rewriterule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc]

webado

unread,
Jul 25, 2008, 9:51:29 AM7/25/08
to Only Validation + Navigation = Crawlability
Seems to me you fixed it amigo :)

http://web-sniffer.net/?url=desarrollowebdequeretaro.com%2Fcomaiz%2F&submit=Submit&http=1.1&type=GET&uak=0

It shows a most perfect 301 redirections from
http://desarrollowebdequeretaro.com/comaiz/

to

http://www.comaiz.com.mx/

which is as it should be :)



And no, public_html is not visible in any http access. It is the
internal folder of the root for the main domain, which on the outside
is / on host desarrollowebdequeretaro.com . So accesed as
http://desarrollowebdequeretaro.com/ (or http://www.desarrollowebdequeretaro.com/
since it's gettign redirected.).


Everything looks OK to me.



On 25 juil, 09:39, speculumcm <speculu...@gmail.com> wrote:
> Hello Webado,
>
> rewriterule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> [r=301,nc]
>
> </Ifmodule>
>
> ErrorDocument 404 /error404.php
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "
>
> Set it just as you describe but re-direct non-www to www it's not
> working :(
>
> "Now for the add-on domain comaiz.com.mx
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> <Ifmodule mod_rewrite.c>
> Options +Indexes +FollowSymlinks
> RewriteEngine on
> RewriteBase /
>
> ### re-direct index.php to root / ###
> RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
> RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
>
> ### re-direct non-www to www
> rewritecond %{http_host} !^www.comaiz.com.mx[nc]
> ...
>
> plus de détails »- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

speculumcm

unread,
Jul 25, 2008, 10:11:52 AM7/25/08
to Only Validation + Navigation = Crawlability
Whoohooo!

Although have a look to this:

http://web-sniffer.net/?url=http%3A%2F%2Fdesarrollowebdequeretaro.com%2Fcomaiz&submit=Submit&http=1.1&type=GET&uak=0

and this:

http://desarrollowebdequeretaro.com it's not going to
http://www.desarrollowebdequeretaro.com/

It seems that when I don't place the "/" get confused. Should I let it
like that?

Muchas gracias nuevamente :)


On 25 jul, 08:51, webado <web...@gmail.com> wrote:
> Seems to me you fixed it amigo :)
>
> http://web-sniffer.net/?url=desarrollowebdequeretaro.com%2Fcomaiz%2F&...
>
> It shows a most perfect 301 redirections fromhttp://desarrollowebdequeretaro.com/comaiz/
>
> to
>
> http://www.comaiz.com.mx/
>
> which is as it should be :)
>
> And no, public_html is not visible in any http access. It is the
> internal folder of the root for the main domain, which on the outside
> is  /  on host desarrollowebdequeretaro.com . So accesed ashttp://desarrollowebdequeretaro.com/(or  http://www.desarrollowebdequeretaro.com/
> ...
>
> leer más »

webado

unread,
Jul 25, 2008, 10:30:08 AM7/25/08
to only-va...@googlegroups.com
That's normal.
 
You are suppsoed to use the url with the trailing slash, because it is a folder. The server adds it via a 301 redirection, this is intrinsic to the server, normal server response.
 
From there the other redirection kicks in to the true location.

 

speculumcm

unread,
Jul 25, 2008, 11:08:22 AM7/25/08
to Only Validation + Navigation = Crawlability
Great, then it working good. However this one it's not doing its
redirection as suppose to do:

http://desarrollowebdequeretaro.com/

Not even with the slash. Also I think it should do it even without the
slash since we are usin:

RewriteBase /

Hmmm, should I try with something else?

On 25 jul, 09:30, webado <web...@gmail.com> wrote:
> That's normal.
>
> You are suppsoed to use the url with the trailing slash, because it is a
> folder. The server adds it via a 301 redirection, this is intrinsic to the
> server, normal server response.
>
> From there the other redirection kicks in to the true location.
>
> On 7/25/08, speculumcm <speculu...@gmail.com> wrote:
>
>
>
> > Whoohooo!
>
> > Although have a look to this:
>
> >http://web-sniffer.net/?url=http%3A%2F%2Fdesarrollowebdequeretaro.com...
>
> > and this:
>
> >http://desarrollowebdequeretaro.comit's not going to
> >http://www.desarrollowebdequeretaro.com/
>
> > It seems that when I don't place the "/" get confused. Should I let it
> > like that?
>
> > Muchas gracias nuevamente :)
>
> > On 25 jul, 08:51, webado <web...@gmail.com> wrote:
> > > Seems to me you fixed it amigo :)
>
> > >http://web-sniffer.net/?url=desarrollowebdequeretaro.com%2Fcomaiz%2F&...
>
> > > It shows a most perfect 301 redirections fromhttp://
> > desarrollowebdequeretaro.com/comaiz/
>
> > > to
>
> > >http://www.comaiz.com.mx/
>
> > > which is as it should be :)
>
> > > And no, public_html is not visible in any http access. It is the
> > > internal folder of the root for the main domain, which on the outside
> > > is  /  on host desarrollowebdequeretaro.com . So accesed ashttp://
> > desarrollowebdequeretaro.com/(or  http://www.desarrollowebdequeretaro.com/
> ...
>
> leer más »

speculumcm

unread,
Jul 25, 2008, 11:20:09 AM7/25/08
to Only Validation + Navigation = Crawlability
I also try with this one:

RewriteCond %{http_host} !^desarrollowebdequeretaro.com[nc]
RewriteRule ^(.*)$ http://www.desarrollowebdequeretaro.com/$1
[r=301,nc,L]

But end up in an infinitive loop :(
It seems that the way the server it's configure doesn't allow me to
canonicalize my maindomain.

On 25 jul, 10:08, speculumcm <speculu...@gmail.com> wrote:
> Great, then it working good. However this one it's not doing its
> redirection as suppose to do:
>
> http://desarrollowebdequeretaro.com/
>
> Not even with the slash. Also I think it should do it even without the
> slash since we are usin:
>
> RewriteBase /
>
> Hmmm, should I try with something else?
>
> On 25 jul, 09:30, webado <web...@gmail.com> wrote:
>
> > That's normal.
>
> > You are suppsoed to use the url with the trailing slash, because it is a
> > folder. The server adds it via a 301 redirection, this is intrinsic to the
> > server, normal server response.
>
> > From there the other redirection kicks in to the true location.
>
> > On 7/25/08, speculumcm <speculu...@gmail.com> wrote:
>
> > > Whoohooo!
>
> > > Although have a look to this:
>
> > >http://web-sniffer.net/?url=http%3A%2F%2Fdesarrollowebdequeretaro.com...
>
> > > and this:
>
> > >http://desarrollowebdequeretaro.comit'snot going to
> ...
>
> leer más »

webado

unread,
Jul 25, 2008, 11:39:55 AM7/25/08
to Only Validation + Navigation = Crawlability
The directive in the .htaccess for the main domain
desarrollowebdequeretaro.com that does the canonical redirections
should be this:

### re-direct non-www to www
rewritecond %{http_host} ^desarrollowebdequeretaro.com[nc]
rewriterule ^(.*)$ http://www.desarrollowebdequeretaro.com/$1
[r=301,nc]



It can also be:


### re-direct non-www to www
rewritecond %{http_host} !^www.desarrollowebdequeretaro.com[nc]
rewriterule ^(.*)$ http://www.desarrollowebdequeretaro.com/$1
[r=301,nc]





On 25 juil, 11:20, speculumcm <speculu...@gmail.com> wrote:
> I also try with this one:
>
> RewriteCond %{http_host} !^desarrollowebdequeretaro.com[nc]
> RewriteRule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> [r=301,nc,L]
>
> But end up in an infinitive loop :(
> It seems that the way the server it's configure doesn't allow me to
> canonicalize my maindomain.
>
> On 25 jul, 10:08, speculumcm <speculu...@gmail.com> wrote:
>
>
>
> > Great, then it working good. However this one it's not doing its
> > redirection as suppose to do:
>
> >http://desarrollowebdequeretaro.com/
>
> > Not even with the slash. Also I think it should do it even without the
> > slash since we are usin:
>
> > RewriteBase /
>
> > Hmmm, should I try with something else?
>
> > On 25 jul, 09:30, webado <web...@gmail.com> wrote:
>
> > > That's normal.
>
> > > You are suppsoed to use the url with the trailing slash, because it is a
> > > folder. The server adds it via a 301 redirection, this is intrinsic to the
> > > server, normal server response.
>
> > > From there the other redirection kicks in to the true location.
>
> > > On 7/25/08, speculumcm <speculu...@gmail.com> wrote:
>
> > > > Whoohooo!
>
> > > > Although have a look to this:
>
> > > >http://web-sniffer.net/?url=http%3A%2F%2Fdesarrollowebdequeretaro.com...
>
> > > > and this:
>
> > > >http://desarrollowebdequeretaro.comit'snotgoing to

speculumcm

unread,
Jul 25, 2008, 12:46:44 PM7/25/08
to Only Validation + Navigation = Crawlability
That is how I had it:
> ### re-direct non-www to www
> rewritecond %{http_host} ^desarrollowebdequeretaro.com[nc]
> rewriterule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> [r=301,nc]

Not redirected.

And this one:

> It can also be:
>
> ### re-direct non-www to www
> rewritecond %{http_host} !^www.desarrollowebdequeretaro.com[nc]
> rewriterule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> [r=301,nc]


Heppend this:

http://desarrollowebdequeretaro.com/ to http://www.desarrollowebdequeretaro.com/

But:

Redirect Loop

Firefox has detected that the server is redirecting the request for
this address in a way that will never complete.

The browser has stopped trying to retrieve the requested item. The
site is redirecting the request in a way that will never complete.

* Have you disabled or blocked cookies required by this site?
* NOTE: If accepting the site's cookies does not resolve the
problem, it is likely a server configuration issue and not your
computer.



On 25 jul, 10:39, webado <web...@gmail.com> wrote:
> The directive in the  .htaccess for the main domain
> desarrollowebdequeretaro.com that does the canonical redirections
> should be this:
>
> ### re-direct non-www to www
> rewritecond %{http_host} ^desarrollowebdequeretaro.com[nc]
> rewriterule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> [r=301,nc]
>
> It can also be:
>
> ### re-direct non-www to www
> rewritecond %{http_host} !^www.desarrollowebdequeretaro.com[nc]
> rewriterule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> ...
>
> leer más »

speculumcm

unread,
Jul 25, 2008, 2:26:15 PM7/25/08
to Only Validation + Navigation = Crawlability
Do you think that the fact that I activated hotlinks from my cPanel
can affect my redirection?

My main .htaccess also has this directives

AddHandler application/x-httpd-
php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://comaiz.com.mx/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://comaiz.com.mx$ [NC]
RewriteCond %{HTTP_REFERER} !^http://
comaiz.desarrollowebdequeretaro.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://
comaiz.desarrollowebdequeretaro.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://desarrollowebdequeretaro.com/.*
$ [NC]
RewriteCond %{HTTP_REFERER} !^http://desarrollowebdequeretaro.com
$ [NC]
RewriteCond %{HTTP_REFERER} !^http://iteci.com.mx/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://iteci.com.mx$ [NC]
RewriteCond %{HTTP_REFERER} !^http://
iteci.desarrollowebdequeretaro.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://iteci.desarrollowebdequeretaro.com
$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.comaiz.com.mx/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.comaiz.com.mx$ [NC]
RewriteCond %{HTTP_REFERER} !^http://
www.comaiz.desarrollowebdequeretaro.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://
www.comaiz.desarrollowebdequeretaro.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://
www.desarrollowebdequeretaro.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.desarrollowebdequeretaro.com
$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.iteci.com.mx/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.iteci.com.mx$ [NC]
RewriteCond %{HTTP_REFERER} !^http://
www.iteci.desarrollowebdequeretaro.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://
www.iteci.desarrollowebdequeretaro.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

Could here be a problem with the redirection you suggested?


On 25 jul, 11:46, speculumcm <speculu...@gmail.com> wrote:
> That is how I had it:
>
> > ### re-direct non-www to www
> > rewritecond %{http_host} ^desarrollowebdequeretaro.com[nc]
> > rewriterule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> > [r=301,nc]
>
> Not redirected.
>
> And this one:
>
> > It can also be:
>
> > ### re-direct non-www to www
> > rewritecond %{http_host} !^www.desarrollowebdequeretaro.com[nc]
> > rewriterule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> > [r=301,nc]
>
> Heppend this:
>
> http://desarrollowebdequeretaro.com/tohttp://www.desarrollowebdequeretaro.com/
> ...
>
> leer más »

webado

unread,
Jul 25, 2008, 3:57:57 PM7/25/08
to only-va...@googlegroups.com
The hotlink protection adds more stuff to the .htaccess - so probaly you have somehtign clashing.
 
Get rid of thsoe for a bit and try again.

 
On 7/25/08, speculumcm <specu...@gmail.com> wrote:

webado

unread,
Jul 25, 2008, 3:59:09 PM7/25/08
to only-va...@googlegroups.com
And the htolink proteciotn has to be handled manually since the main domain and add-on domain are not in the same folder. Don't rely on Cpanel to do it right, only to show how to do it.

speculumcm

unread,
Jul 25, 2008, 4:54:23 PM7/25/08
to Only Validation + Navigation = Crawlability
I desabled it and all the htaccess no it's like this:

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

### re-direct non-www to www
RewriteCond %{http_host} ^desarrollowebdequeretaro.com[nc]
RewriteRule ^(.*)$ http://www.desarrollowebdequeretaro.com/$1
[r=301,nc]
</Ifmodule>

ErrorDocument 404 /error404.php

AddHandler application/x-httpd-
php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

But even like that can't get
Don't get it.

On 25 jul, 14:59, webado <web...@gmail.com> wrote:
> And the htolink proteciotn has to be handled manually since the main domain
> and add-on domain are not in the same folder. Don't rely on Cpanel to do it
> right, only to show how to do it.
>
> On 7/25/08, webado <web...@gmail.com> wrote:
>
>
>
> > The hotlink protection adds more stuff to the .htaccess - so probaly you
> > have somehtign clashing.
>
> > Get rid of thsoe for a bit and try again.
>
> >>http://desarrollowebdequeretaro.com/tohttp://www.desarrollowebdequere...
> ...
>
> leer más »

webado

unread,
Jul 25, 2008, 7:27:50 PM7/25/08
to Only Validation + Navigation = Crawlability
Are you sure you didn't break the directives on multiple lines, the
way they apepar here?
Because then this won't work. usualy it shows an error but I guess it
could just fail to do the job.

Is this .htaccess in the root of this domain? This would be the
public_html folder you have if that's how you are set up.


It's very weird and quite unexplainable.

Remove the <Ifmodule mod_rewrite.c> and the </Ifmodule> lines and
let's see.

Also is there anything in the index.php file that might interfere as
well?
> > leer m�s �

speculumcm

unread,
Jul 25, 2008, 8:20:03 PM7/25/08
to Only Validation + Navigation = Crawlability
> Are you sure you didn't break the directives on multiple lines, the
> way they apepar here?

I'm sure I didn't break the lines. I know that would be an error,
actually I did it before :|

> Is this .htaccess in the root of this domain? This would be the
> public_html folder you have if that's how you are set up.

Yes it is the root of the mainDomain public_html/.htaccess

> Remove the <Ifmodule mod_rewrite.c> and the </Ifmodule> lines and
> let's see.

I've done it. Same result :(

>
> Also is there anything in the index.php file that might interfere as
> well?

No, at the moment I just uploaded to test the directives in the main
domain but it a pure static page with an php extension.

I know it's very weird. All your suggestions works very well in my
addonDomains. Don't understand why this simple directive doesn't work
in my mainDomain. I'm totally puzzle.

On 25 jul, 18:27, webado <web...@gmail.com> wrote:
> Are you sure you didn't break the directives on multiple lines, the
> way they apepar here?
> Because then this won't work. usualy it shows an error but I guess it
> could just fail to do the job.
>
> Is this .htaccess in the root of this domain? This would be the
> public_html folder you have if that's how you are set up.
>
> It's very weird and quite unexplainable.
>
> Remove the  <Ifmodule mod_rewrite.c> and the </Ifmodule> lines and
> let's see.
>
> Also is there anything in the index.php file that might interfere as
> well?
>
> speculumcm wrote:
> > I desabled it and all the htaccess no it's like this:
>
> > <Ifmodule mod_rewrite.c>
> > Options +Indexes +FollowSymlinks
> > RewriteEngine on
> > RewriteBase /
>
> > ### re-direct index.php to root / ###
> > RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
> > RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
>
> > ### re-direct non-www to www
> > RewriteCond %{http_host} ^desarrollowebdequeretaro.com[nc]
> > RewriteRule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> > [r=301,nc]
> > </Ifmodule>
>
> > ErrorDocument 404 /error404.php
>
> > AddHandler application/x-httpd-
> > php5 .php5 .php4 .php .php3 .php2 .phtml
> > AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
>
> > But even like that can't get
> >http://desarrollowebdequeretaro.com/tohttp://www.desarrollowebdequeretaro.com/
> ...
>
> leer más »

webado

unread,
Jul 25, 2008, 8:44:04 PM7/25/08
to Only Validation + Navigation = Crawlability
This is crazy.

Sorry, I'm totlaly out of any other ideas. Call your hoster and ask
them what's going on.

There must be somehting in the httpd.conf file or some such place that
affects this.

Maybe the mod_rewrite module is not installed and active for the main
domain. But it is for the add-on domains. Weird.

If you cannot make it work I would add scripting at the top of
index.php and all other pages to check host and 301 redirect to the
www version.

<?php

$http_host = $_SERVER['HTTP_HOST'];
$request_uri = $_SERVER['REQUEST_URI'];
$query_string = $_SERVER['QUERY_STRING'];

if ($http_host == "desarrollowebdequeretaro.com") {

// rebuild the url with www in front

$new_url = http://www." . $http_host . $request_uri;
// or it could also be:
// $new_url = http://www." . $http_host . $php_self . "?" .
$query_string;

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

?>

speculumcm

unread,
Jul 25, 2008, 10:26:19 PM7/25/08
to Only Validation + Navigation = Crawlability
You're absolutely right. I give your suggestions to other guy that is
in the same hosting and the redirections work good for him in
mainDomain and addonDomain. So sure there must be something wrong with
my account. I'm going to open a ticket support and see what could get
from them and let you know it.

Also I want to thank you again for all your support. You are amazing!

Kindest Regards,

Un amigo y admirador speculumcm

On 25 jul, 19:44, webado <web...@gmail.com> wrote:
> This is crazy.
>
> Sorry, I'm totlaly out of any other ideas. Call your hoster and ask
> them what's going on.
>
> There must be somehting in the httpd.conf file or some such place that
> affects this.
>
> Maybe  the mod_rewrite module is not installed and active for the main
> domain. But it is for the add-on domains. Weird.
>
> If you cannot make it work I would add scripting at the top of
> index.php and all other pages to check host and 301 redirect to the
> www version.
>
> <?php
>
> $http_host = $_SERVER['HTTP_HOST'];
> $request_uri = $_SERVER['REQUEST_URI'];
> $query_string = $_SERVER['QUERY_STRING'];
>
> if ($http_host == "desarrollowebdequeretaro.com")  {
>
> // rebuild the url with www in front
>
> $new_url =http://www." . $http_host . $request_uri;
> > > >http://desarrollowebdequeretaro.com/tohttp://www.desarrollowebdequere...
> ...
>
> leer más »

webado

unread,
Jul 25, 2008, 10:49:34 PM7/25/08
to Only Validation + Navigation = Crawlability
My pleasure.

Good luck finding the problem.

It must be something very silly. Usually the case.

I'm thinking along the lines of Frontpage extensions being enabled and
other .htaccess directives kicking in.

webado

unread,
Jul 25, 2008, 10:51:29 PM7/25/08
to Only Validation + Navigation = Crawlability
If you don't need Frontpage get rid of those extensions, they are only
trouble.

Duncan Hill

unread,
Jul 26, 2008, 5:27:18 AM7/26/08
to only-va...@googlegroups.com
Hi,

I certainly can't add to any of the work that Webado has done for your
problem, but this link might provide a bit of extra information. There are
lots of different .htaccess examples, you will need to scroll down, the
posts are mixed amongst other topics.

http://www.askapache.com/

Good luck

Duncan

On Sat, 26 Jul 2008 03:26:19 +0100, speculumcm <specu...@gmail.com>
wrote:
--
Duncan Hill
(DHadmin)

speculumcm

unread,
Jul 27, 2008, 9:14:48 AM7/27/08
to Only Validation + Navigation = Crawlability
Thank you Duncan excellent link!

Hello webado,

Finally found the solution!!

This was what my support host give me

First for the main domain I just change this:

RewriteCond %{http_host} ^desarrollowebdequeretaro.com[nc]
RewriteRule ^(.*)$ http://www.desarrollowebdequeretaro.com/$1
[r=301,nc]

to this:

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

And for the problem of showing the whole root server in the browser
they point me to this link:

http://www.webmasterworld.com/apache/3403983.htm

I had to combine their solution with yours and resulted in this:

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

# trailing slash
# If URL-path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
# add a trailing slash
RewriteRule .* http://www.comaiz.com.mx%{REQUEST_URI}/ [R=301,L]
#
# Canonicalize the domain
# Redirect non-www domain requests to www domain
RewriteCond %{http_host} !^www.comaiz.com.mx [nc]
RewriteRule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc,L]

</Ifmodule>

#### re-direct error 404
ErrorDocument 404 /error404.php

Now everything seems to work as it should work. Is that correct or am
I adding extra code?

RewriteCond %{http_host} ^comaiz.



On 26 jul, 04:27, "Duncan Hill" <dhad...@mndhill.com> wrote:
> Hi,
>
> I certainly can't add to any of the work that Webado has done for your  
> problem, but this link might provide a bit of extra information. There are  
> lots of different .htaccess examples, you will need to scroll down, the  
> posts are mixed amongst other topics.
>
> http://www.askapache.com/
>
> Good luck
>
> Duncan
>
> On Sat, 26 Jul 2008 03:26:19 +0100, speculumcm <speculu...@gmail.com>  
> ...
>
> leer más »

webado

unread,
Jul 27, 2008, 11:13:24 AM7/27/08
to Only Validation + Navigation = Crawlability
Hm, that fist conditin was suppsoed to be:

RewriteCond %{http_host} ^desarrollowebdequeretaro.com [nc]

with a blank before [nc].

The [nc] simply says not to worry about the case, if it's lower or
upper case. It can be left out but it might then indicate to take the
value as entered with no transformation. Not sure.

As to why a $ may have been needed at the end of the host value to
test against, I don't know. I'm not seeing that need in my own
applications, they work just like that.


The trailing slash I didn't mention since yuor server already did add
that anyway. So I think that's redundant.
I have directives to add that but it's different from yours, and it's
only to be used on servers where it's not already being added.

I'm confused LOL

There are usually small diffrences in how Apache https.conf is set
up (a master file that's similar to the .htaccess file but with a
lot more directives that apply to the whole server) - but you
generally won't have access to that file on shared hosting, as it's at
a higher level than your home directory. So you use the .htaccess file
which available to be used in the root or lower directories, where you
have access.

Sometimes diretcives used in httpd.conf conflict with what you try to
use in .htaccess. Some you can override, some you cannot. Mystery to
me. It's often just a lot of trial and error.

Sometimes if you have Cpanel it can actually geenrate the .htaccess
diretcives for some kinds of redirectons, even the ones for the
canonical domain form. I haven't tried on mine, I think I saw it
mentioned. Often what Cpanel concocts will conflict with other things
or mess up outright so I don't trust it too much to do things right.

But look what happens here:

http://web-sniffer.net/?url=http%3A%2F%2Fwww.desarrollowebdequeretaro.com%2Fcomaiz&submit=Submit&http=1.1&gzip=yes&type=GET&uak=0

http://www.desarrollowebdequeretaro.com/comaiz
gets 301 redirected to:

http://www.comaiz.com.mx/comaiz/

which is obviously incorrect.


It shoudl have been 301 redirected to
http://www.desarrollowebdequeretaro.com/comaiz/

which should in turn get 301 redirected to the add-on domain
http://www.comaiz.com.mx/

by proper directives in the /comaiz/ folder.

You had the http://www.desarrollowebdequeretaro.com/comaiz/
redirection ok the other day.


This however works as expected:
http://www.desarrollowebdequeretaro.com/comaiz/
and gets rdirected to
http://www.comaiz.com.mx/


So what doesn't work is the thing about adding the trailing slash.

SInce it was working the other days without what you just added now,
which is:

# trailing slash
# If URL-path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
# add a trailing slash
RewriteRule .* http://www.comaiz.com.mx%{REQUEST_URI}/ [R=301,L]

If you added this to the .htaccess in the /comaiz/ folder then see
what this does:

I access http://www.desarrollowebdequeretaro.com/comaiz so the value
of REQUEST_URI will be:
/comaiz
Then trailing slash directive kicks in and does as instructed a
redorection to http://www.comaiz.com.mx strung out with the
REQUEST_URI value /comaiz added after it and finally the trialing
slash is added. Clearly incorrect.

It works OK if the access was to http://www.comaiz.com.mx/somefolder ,
which goes through the same .htaccess file .

So the only way that directive could work is if it were modified to
add as a condition that the http_host is specifically comaiz.com.mx or
www.comaiz.com.mx .

So it would be this and stated twice once for each variant of the
domain:

~~~~~~~~~~~~
# trailing slash
# If URL-path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$) [AND]
RewriteCond %{HTTP_HOST} ^comaiz.com.mx
# add a trailing slash
RewriteRule .* http://www.comaiz.com.mx%{REQUEST_URI}/ [R=301,L]

# trailing slash
# If URL-path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$) [AND]
RewriteCond %{HTTP_HOST} ^www.comaiz.com.mx
# add a trailing slash
RewriteRule .* http://www.comaiz.com.mx%{REQUEST_URI}/ [R=301,L]

~~~~~~~~~~~~~


Remember the above goes into the /comaiz/ folder which is at the same
time root of comaiz.com.mx (hence the problem)


In the root of the MAIN domain you'd have the regular directive
without the need to test for the HTTP_HOST value:

~~~~~~~~~~~~
# trailing slash
# If URL-path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
# add a trailing slash
RewriteRule .* http://www.desarrollowebdequeretaro.com%{REQUEST_URI}/
[R=301,L]

~~~~~~~~~~~~~

In the above you need not worry about which domain is being acccess
sicne the only one that could be is the main domain, otherwise we'd
not be accessing its root.


But as I said, I believe these directives are not needed on your
server at all, as most servers already compensate for the missing
trailing slash and add it themselves and test and do the 301
redirection properly. In rare cases one needs to do it like this or
similar fashions.

speculumcm

unread,
Jul 27, 2008, 2:40:26 PM7/27/08
to Only Validation + Navigation = Crawlability
Seems It's solved but first answering your comments, questions and
suggestions:

> Hm, that fist conditin was suppsoed to be:
>
> RewriteCond %{http_host} ^desarrollowebdequeretaro.com [nc]
>
> with a blank before [nc].

Yes, in the original it's how it was.

> The trailing slash I didn't mention since yuor server already did add
> that anyway. So I think that's redundant.

Again you're right, I removed them.

>
> I'm confused LOL
>

Imagine how I am 8)

>
> ~~~~~~~~~~~~
> # trailing slash
> # If URL-path does not contain a period or end with a slash
...

> ~~~~~~~~~~~~~
>
> Remember the above goes into the /comaiz/ folder which is at the same
> time root of comaiz.com.mx (hence the problem)

Adding that code throws an Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.

And the trailing slash code for the main domain it's not needed just
as you've already mentioned.

I found something here:

http://www.webmasterworld.com/apache/3395854.htm

with this suggestion:

RewriteCond %{HTTP_HOST} ^(.*\.)?main-host\.com$ [NC]
RewriteRule ^(/home/accountname/public_html/subdir)?(.*)$ http://example.com/$2
[R=301,L]

So after going in an heuristic way, the .htaccess file in /comaiz/
ends up like:

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

# Canonicalize the domain
# Redirect non-www domain requests to www domain
RewriteCond %{http_host} !^www.comaiz.com.mx [nc]
RewriteRule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc]

## re-direct main domain to specific addon domain
RewriteCond %{HTTP_HOST} ^(.*\.)?desarrollowebdequeretaro\.com$ [NC]
RewriteRule ^(.*)$ http://www.comaiz.com.mx/$2 [R=301,L]

</Ifmodule>

#### re-direct error 404
ErrorDocument 404 /error404.php

It seems to working properly. Look:

http://web-sniffer.net/?url=http%3A%2F%2Fdesarrollowebdequeretaro.com%2Fcomaiz&submit=Submit&http=1.1&type=GET&uak=0

What do you think?
> http://web-sniffer.net/?url=http%3A%2F%2Fwww.desarrollowebdequeretaro...
>
> http://www.desarrollowebdequeretaro.com/comaiz
> gets 301 redirected to:
>
> http://www.comaiz.com.mx/comaiz/
>
> which is obviously incorrect.
>
> It shoudl have been 301 redirected tohttp://www.desarrollowebdequeretaro.com/comaiz/
>
> which should in turn get 301 redirected to the add-on domainhttp://www.comaiz.com.mx/
>
> by proper directives in the /comaiz/ folder.
>
> You had thehttp://www.desarrollowebdequeretaro.com/comaiz/
> redirection ok the other day.
>
> This however works as expected:http://www.desarrollowebdequeretaro.com/comaiz/
> and gets rdirected tohttp://www.comaiz.com.mx/
>
> So what doesn't work is the thing about adding the trailing slash.
>
> SInce it was working the other days without what you just added now,
> which is:
>
> # trailing slash
> # If URL-path does not contain a period or end with a slash
> RewriteCond %{REQUEST_URI} !(\.|/$)
> # add a trailing slash
> RewriteRule .*http://www.comaiz.com.mx%{REQUEST_URI}/ [R=301,L]
>
> If you added this to the .htaccess in the /comaiz/ folder then see
> what this does:
>
> I accesshttp://www.desarrollowebdequeretaro.com/comaiz so  the value
> of REQUEST_URI will be:
> /comaiz
> Then trailing slash directive kicks in and does as instructed a
> redorection tohttp://www.comaiz.com.mxstrung out with the
> REQUEST_URI value /comaiz added after it and finally the trialing
> slash is added. Clearly incorrect.
>
> It works OK if the access was tohttp://www.comaiz.com.mx/somefolder,
> which goes through the same .htaccess file .
>
> So the only way that directive could work is if it were modified to
> add as a condition that the http_host is specifically comaiz.com.mx orwww.comaiz.com.mx.
>
> So it would be this and stated twice once for each variant of the
> domain:
>
> ~~~~~~~~~~~~
> # trailing slash
> # If URL-path does not contain a period or end with a slash
> RewriteCond %{REQUEST_URI} !(\.|/$) [AND]
> RewriteCond %{HTTP_HOST} ^comaiz.com.mx
> # add a trailing slash
> RewriteRule .*http://www.comaiz.com.mx%{REQUEST_URI}/ [R=301,L]
>
> # trailing slash
> # If URL-path does not contain a period or end with a slash
> RewriteCond %{REQUEST_URI} !(\.|/$) [AND]
> RewriteCond %{HTTP_HOST} ^www.comaiz.com.mx
> # add a trailing slash
> RewriteRule .*http://www.comaiz.com.mx%{REQUEST_URI}/ [R=301,L]
>
> ~~~~~~~~~~~~~
>
> Remember the above goes into the /comaiz/ folder which is at the same
> time root of comaiz.com.mx (hence the problem)
>
> In the root of the MAIN domain you'd have the regular directive
> without the need to test for the HTTP_HOST value:
>
> ~~~~~~~~~~~~
> # trailing slash
> # If URL-path does not contain a period or end with a slash
> RewriteCond %{REQUEST_URI} !(\.|/$)
> # add a trailing slash
> RewriteRule .*http://www.desarrollowebdequeretaro.com%{REQUEST_URI}/
> [R=301,L]
>
> ~~~~~~~~~~~~~
>
> In the above you need not worry about which domain is being acccess
> sicne the only one that could be is the main domain, otherwise we'd
> not be accessing its root.
>
> But as I said, I believe these directives are not needed on your
> server at all, as most servers already compensate for the missing
> trailing slash and add it themselves and test and do the 301
> redirection properly. In rare cases one needs to do it like this or
> similar fashions.
>
> speculumcm wrote:
> > Thank you Duncan excellent link!
>
> > Hello webado,
>
> > Finally found the solution!!
>
> > This was what my support host give me
>
> > First for the main domain I just change this:
>
> > RewriteCond %{http_host} ^desarrollowebdequeretaro.com[nc]
> > RewriteRule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> > [r=301,nc]
>
> >  to this:
>
> > RewriteCond %{http_host} ^desarrollowebdequeretaro.com$
> > RewriteRule ^(.*)$http://www.desarrollowebdequeretaro.com/$1
> > [L,R=301]
>
> > And for the problem of showing the whole root server in the browser
> > they point me to this link:
>
> >http://www.webmasterworld.com/apache/3403983.htm
>
> > I had to combine their solution with yours and resulted in this:
>
> > <Ifmodule mod_rewrite.c>
> > Options +Indexes +FollowSymlinks
> > RewriteEngine on
> > RewriteBase /
>
> > ### re-direct index.php to root / ###
> > RewriteCond %{THE_REQUEST} ^.*\ /.*index\.php\ HTTP/
> > RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
>
> > # trailing slash
> > # If URL-path does not contain a period or end with a slash
> > RewriteCond %{REQUEST_URI} !(\.|/$)
> > # add a trailing slash
> > RewriteRule .*http://www.comaiz.com.mx%{REQUEST_URI}/ [R=301,L]
> > #
> > # Canonicalize the domain
> > # Redirect non-www domain requests to www domain
> > RewriteCond %{http_host} !^www.comaiz.com.mx[nc]
> > RewriteRule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc,L]
> ...
>
> leer más »

webado

unread,
Jul 27, 2008, 2:59:29 PM7/27/08
to Only Validation + Navigation = Crawlability
This already takes care of what the other one would.

# Canonicalize the domain
# Redirect non-www domain requests to www domain
RewriteCond %{http_host} !^www.comaiz.com.mx$ [nc]
RewriteRule ^(.*)$ http://www.comaiz.com.mx/$1 [r=301,nc]




> > leer m�s �

speculumcm

unread,
Jul 27, 2008, 3:12:44 PM7/27/08
to Only Validation + Navigation = Crawlability
It's supposed to do that but with desarrollowebdequeretaro.com/comaiz
goes to the public_html folder with the error 404 page.
Actually reading others forums seems to be quite common with addon
domains. If I remove this lines:

RewriteCond %{HTTP_HOST} ^(.*\.)?desarrollowebdequeretaro\.com$ [NC]
RewriteRule ^(.*)$ http://www.comaiz.com.mx/$2 [R=301,L]

It won't work with desarrollowebdequeretaro.com/comaiz just as I've
mentioned.
I agree with you that adding this code sounds redundant but for some
inexplicable reason I need it :(
May be there must be a shorter version of this code where include non-
www to www and redirect main domain to the specific addon domain in
the form that it's causing the issue. Don't know.

On 27 jul, 13:59, webado <web...@gmail.com> wrote:
> This already takes care of what the other one would.
>
> # Canonicalize the domain
> # Redirect non-www domain requests to www domain
> RewriteCond %{http_host} !^www.comaiz.com.mx$[nc]
> RewriteRule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc]
> > RewriteRule ^(/home/accountname/public_html/subdir)?(.*)$http://example.com/$2
> > [R=301,L]
>
> > So after going in an heuristic way, the .htaccess file in /comaiz/
> > ends up like:
>
> > <Ifmodule mod_rewrite.c>
> > Options +Indexes +FollowSymlinks
> > RewriteEngine on
> > RewriteBase /
>
> > ### re-direct index.php to root / ###
> > RewriteCond %{THE_REQUEST} ^.*\ /.*index\.php\ HTTP/
> > RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
>
> > # Canonicalize the domain
> > # Redirect non-www domain requests to www domain
> > RewriteCond %{http_host} !^www.comaiz.com.mx[nc]
> > RewriteRule ^(.*)$http://www.comaiz.com.mx/$1[r=301,nc]
>
> > ## re-direct main domain to specific addon domain
> > RewriteCond %{HTTP_HOST} ^(.*\.)?desarrollowebdequeretaro\.com$ [NC]
> > RewriteRule ^(.*)$http://www.comaiz.com.mx/$2[R=301,L]
>
> > </Ifmodule>
>
> > #### re-direct error 404
> > ErrorDocument 404 /error404.php
>
> > It seems to working properly. Look:
>
> >http://web-sniffer.net/?url=http%3A%2F%2Fdesarrollowebdequeretaro.com...
> > > redorection tohttp://www.comaiz.com.mxstrungout with the
> ...
>
> leer más »

webado

unread,
Jul 27, 2008, 3:41:08 PM7/27/08
to Only Validation + Navigation = Crawlability
I think that adds in the element of a subdomain, since an add-on
domain is
1) a folder in the main domain
2) a subdomain mapped to that folder of the main domain
3) an add-on domain mapped to the subdomain that's mapped to the
folder of the main domain


The subdomain also has to be redirected to the add-on domain. And what
I gave shoudl do it becaue regardless how you got to that folder
(whether it's considered the the /comaiz/ folde rin the main domain,
or the root folder of the comaiz subdomain or the root folder of the
comaiz.com.mz add-on domain, since they are one and the same folder,
the redirection shoudl work, sicne we are at all times testing agains
the current HTTP_HOST .



1) When you access your main domain, HTTP_HOST is the main domain
desarrollowebdequeretaro.com or www.desarrollowebdequeretaro.com -
depending.

2) When you access the /comaiz/ as a folder in your main domain,
HTTP_HOST is the main domain again, just like above.

3) When you access the comaiz subdomain, HTTP_HOST is
comaiz.desarrollowebdequeretaro.com or www.comaiz.desarrollowebdequeretaro.com
, depending.

4) When you access the comaiz add-on domain, HTTP_HOST is
comaiz.com.mx or www.comaiz.com.mx , depending.


All 4 of the above accesses are to the same physical folder, so
there's just the one .htaccees file that is there that governs.
Actually to be more accurate if you are accessing 2) then
the .htaccess directives that get applied are those in the root of the
main domain PLUS those in the folder comaiz .

In 3 and 4 it's the local .htaccess diretives that apply, as there's
no hihger folder above that - that being root.

2, 3 and 4 all access the contents of what ultimately is your
comaiz.com.mx domain (same as the subdmain, same as the folder of the
main domain).

In those cases (2,3,4) you want to ensure that the HTTP_HOST is
www.comaiz.com.mx .

In other words, in 2,3,4, you want to 301 redirect to www.comaiz.com.mx
ALL accesses for which HTTP_HOST is NOT www.comaiz.com.mx .

It's not necesasry to test whether HTTP_HOST is the subdomain
comaiz.desarrollowebdequeretaro.com or any subdomain for that matter
(it can happen that the name of the subdomain is different from the
add-domain's part befoe the tld, it depends how you added the add-on
domain).

So I see no need to test for HTTP_HOST being a subdomain. I will test
that it is NOT the add-on domain and act accordingly.


However what may be happening here is that in your Apache version
HTTP_HOST is not what I expect. And this can only be confirmed by
writign a little scritp to out the value of HTTP_HOST in all of the 3
possibilities that concern that folder.


Make this little script in Notepad:

<?php
echo $_SERVER['HTTP_HOST'];
?>

Save it under the name test-host.php and upload it to your comaiz
folder.


Then go and access:

1) http://www.desarrollowebdequeretaro.com /comaiz/test-host.php
2) http://comaiz.desarrollowebdequeretaro.com/test-host.php
3) http://www.comaiz.com.mx/test-host.php


The results SHOULD be:

1) www.desarrollowebdequeretaro.com
2) comaiz.desarrollowebdequeretaro.com
3) www.comaiz.com.mx


if thats' nto the case, let me know, don't remove the script so I can
see it as well.

speculumcm

unread,
Jul 27, 2008, 4:08:17 PM7/27/08
to Only Validation + Navigation = Crawlability
I did the test-host.php file. You can check it now.
1) and 2) go to the page of comaiz, just the 3) do what you expected

On 27 jul, 14:41, webado <web...@gmail.com> wrote:
> I think that adds in the element of a subdomain, since an add-on
> domain is
> 1) a folder in the main domain
> 2) a subdomain mapped to that folder of the main domain
> 3) an add-on domain mapped to the subdomain that's mapped to the
> folder of the main domain
>
> The subdomain also has to be redirected to the add-on domain. And what
> I gave shoudl do it becaue regardless how you got to that folder
> (whether it's considered the the /comaiz/ folde rin the main domain,
> or the root folder of the comaiz subdomain or the root folder of the
> comaiz.com.mz add-on domain, since they are one and the same folder,
> the redirection shoudl work, sicne we are at all times testing agains
> the current HTTP_HOST .
>
> 1) When you access your main domain, HTTP_HOST  is the main domain
> desarrollowebdequeretaro.com orwww.desarrollowebdequeretaro.com-
> depending.
>
> 2) When you access the /comaiz/ as a folder in your main domain,
> HTTP_HOST  is the main domain again, just like above.
>
> 3) When you access the comaiz subdomain, HTTP_HOST  is
> comaiz.desarrollowebdequeretaro.com orwww.comaiz.desarrollowebdequeretaro.com
> , depending.
>
> 4) When you access the comaiz add-on domain, HTTP_HOST  is
> comaiz.com.mx orwww.comaiz.com.mx, depending.
> 3)http://www.comaiz.com.mx/test-host.php
>
> The results SHOULD be:
>
> 1)www.desarrollowebdequeretaro.com
> 2) comaiz.desarrollowebdequeretaro.com
> 3)www.comaiz.com.mx
>
> if thats' nto the case, let me know, don't remove the script so I can
> see it as well.
>
> speculumcm wrote:
> > It's supposed to do that but with desarrollowebdequeretaro.com/comaiz
> > goes to the public_html folder with the error 404 page.
> > Actually reading others forums seems to be quite common with addon
> > domains. If I remove this lines:
>
> > RewriteCond %{HTTP_HOST} ^(.*\.)?desarrollowebdequeretaro\.com$ [NC]
> > RewriteRule ^(.*)$http://www.comaiz.com.mx/$2[R=301,L]
> ...
>
> leer más »

speculumcm

unread,
Jul 27, 2008, 4:09:16 PM7/27/08
to Only Validation + Navigation = Crawlability
Ah, I let the file there to you :)
> ...
>
> leer más »

webado

unread,
Jul 27, 2008, 4:25:31 PM7/27/08
to Only Validation + Navigation = Crawlability


All already redirect LOL but they don't keep the uri - why? The
redirection should preserve the relevant part of request_uri .


I intended to see what that script does without the benefit of
those .htaccess files that redirect ;)
> ...
>
> read more »- Hide quoted text -
>
> - Show quoted text -

speculumcm

unread,
Jul 27, 2008, 4:26:21 PM7/27/08
to Only Validation + Navigation = Crawlability
Well rereading your last post I think it's doing exactly what it's
suppose to do, isn't it?
> ...
>
> leer más »

speculumcm

unread,
Jul 27, 2008, 4:30:26 PM7/27/08
to Only Validation + Navigation = Crawlability
OK, I'm going to take this htaccess just for a while and see what
happens.

:)
> ...
>
> leer más »

speculumcm

unread,
Jul 27, 2008, 4:35:37 PM7/27/08
to Only Validation + Navigation = Crawlability
Aha! You can check it, without htacces benefit it's doing exactly what
you said.
> ...
>
> leer más »

webado

unread,
Jul 27, 2008, 5:28:32 PM7/27/08
to Only Validation + Navigation = Crawlability
It's redirecting all of them to http://www.comaiz.com.mx/ but it
should all end up at http://www.comaiz.com.mx/test-host.php if the
redirectiosn are to be considered good.

And since it's still redirecting, it means you didn't remove
the .htaccess directives LOL or went in too quickly and put them back
befroe I had a chance to test.

speculumcm

unread,
Jul 27, 2008, 6:15:18 PM7/27/08
to Only Validation + Navigation = Crawlability
Sorry, you're right, I've already place the redirections again.

1) http://www.desarrollowebdequeretaro.com/alexboutique/test-host.php
2) http://comaiz.desarrollowebdequeretaro.com/test-host.php
3) http://www.alexboutique.com.mx/test-host.php

And goes to:

1) www.desarrollowebdequeretaro.com
2) alexboutique.desarrollowebdequeretaro.com
3) www.alexboutique.com.mx

This is in the same account but not been developed I can play with
that more time, so I'm going to let this one without redirection for a
while just in case you've already gone some where else you can check
it tomorrow if you want :)

On 27 jul, 16:28, webado <web...@gmail.com> wrote:
> It's redirecting all of them tohttp://www.comaiz.com.mx/but it
> should all end up at  http://www.comaiz.com.mx/test-host.phpif the
> ...
>
> leer más »

Christina S

unread,
Jul 27, 2008, 8:55:15 PM7/27/08
to only-va...@googlegroups.com
It loks like the HTTP_HOST values are as expected. 2) of coures using
alexboutique not comaiz.

Again I see no reason why the .htaccess as I had given it shoudlnt' work as
expected.

And I see yours isn't working quite right to 301 redirect AND transfer the
page uri properly.One mroe thing you cna try in the root of the main domain:


Rediect 301 /comaiz http://www.comaiz.com.mx/

Redirect 301 /alexboutique http://www.alexboutique.com.mx/

and so on fro each of yrou add-on domains.



Then the directives that only deal with the main domain itself: to redirect
index.php to root, to redirect non-www to www for the main domain..


In each of the subdirectories add directives whcih deal with just that
add-on domain itself: to redirect index.php to root of the add-on domain, to
redirect non-www to www for the add-on domain..


Christina
www.webado.net

speculumcm

unread,
Jul 28, 2008, 9:22:16 AM7/28/08
to Only Validation + Navigation = Crawlability
Hello Christina S,

I tried your suggestion in alexboutique but same result it's
redirecting to the public_html folder :(

http://web-sniffer.net/?url=http%3A%2F%2Fdesarrollowebdequeretaro.com%2Falexboutique&submit=Submit&http=1.1&type=GET&uak=0

Sorry for changing from comaiz to alexboutique though it's in the same
public folder and behave in the same way as comaiz and it's easier for
me to test alexboutique since it hasn't been developed jet.
> ...
>
> leer más »

webado

unread,
Jul 28, 2008, 9:28:16 AM7/28/08
to only-va...@googlegroups.com
This works:
 
So the problem is the adding or not adding of the trailing slash.
 
Remove the .htacess code dealign with that and let's see.
 
I'm at work, so won't be able to respond fast.

 

speculumcm

unread,
Jul 28, 2008, 10:26:29 AM7/28/08
to Only Validation + Navigation = Crawlability
I think I clean all the code dealing with trailing slash now looks
like this:

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

### re-direct non-www to www
rewritecond %{http_host} !^www.alexboutique.com.mx [nc]
rewriterule ^(.*)$ http://www.alexboutique.com.mx/$1 [r=301,nc]
</Ifmodule>

But the problem persist. Really weird indeed

On 28 jul, 08:28, webado <web...@gmail.com> wrote:
> This works:http://web-sniffer.net/?url=http%3A%2F%2Fdesarrollowebdequeretaro.com...
>
> So the problem is the adding or not adding of the trailing slash.
>
> Remove the .htacess code dealign with that and let's see.
>
> I'm at work, so won't be able to respond fast.
>
> On 7/28/08, speculumcm <speculu...@gmail.com> wrote:
>
>
>
> > Hello Christina S,
>
> > I tried your suggestion in alexboutique but same result it's
> > redirecting to the public_html folder :(
>
> >http://web-sniffer.net/?url=http%3A%2F%2Fdesarrollowebdequeretaro.com...
> ...
>
> leer más »

Christina S

unread,
Jul 28, 2008, 6:58:07 PM7/28/08
to only-va...@googlegroups.com
Check the .htaccess in the main domain root folder. It has somehting that
tries to redirect when there's no traling alsh and it's wrong.


Also pleace check all .htaccess file. Every rewriterule has to ennd with
[R=301,NC, L}

For this:

### re-direct non-www to www
rewritecond %{http_host} !^www.alexboutique.com.mx [nc]


where is the rest? That's the condition but nothing is done?


Why don't you zip the .htaccess file from the root and the one from the
alexboutique folder, separately, and send them to me at webado [ at ]
gmail.com ?

I will fix them and email you back.

Christina
www.webado.net

----- Original Message -----
From: "speculumcm" <specu...@gmail.com>
To: "Only Validation + Navigation = Crawlability"
<only-va...@googlegroups.com>
Sent: Monday, July 28, 2008 10:26 AM
Subject: Only Validation Re: Discussion on
fix-canonical-issues-www-vs-non-www-and-more-on-apache-server



I think I clean all the code dealing with trailing slash now looks
like this:

<Ifmodule mod_rewrite.c>
Options +Indexes +FollowSymlinks
RewriteEngine on

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

### re-direct non-www to www
rewritecond %{http_host} !^www.alexboutique.com.mx [nc]

speculumcm

unread,
Jul 28, 2008, 7:59:04 PM7/28/08
to Only Validation + Navigation = Crawlability
OK, I sent it the file to you. Oh BTW I remove the last slash of the
htacces just to tes but I've already tried with the slash in:

Redirect 301 /alexboutique http://www.alexboutique.com.mx/ but
didn't work either :(


Thank you for all your caring.

On 28 jul, 17:58, "Christina S" <web...@gmail.com> wrote:
> Check the .htaccess in the main domain root folder. It has somehting that
> tries to redirect when there's no traling alsh and it's wrong.
>
> Also pleace check all .htaccess file. Every rewriterule has to ennd with
> [R=301,NC, L}
>
> For this:
>
> ### re-direct non-www to www
> rewritecond %{http_host} !^www.alexboutique.com.mx[nc]
>
> where is the rest? That's the condition but nothing is done?
>
> Why don't you zip the .htaccess file from the root and the one from the
> alexboutique folder, separately,  and send them to me  at webado [ at ]
> gmail.com ?
>
> I will fix them and email you back.
>
> Christinawww.webado.net
>
> ----- Original Message -----
> From: "speculumcm" <speculu...@gmail.com>
> To: "Only Validation + Navigation = Crawlability"
>
> <only-va...@googlegroups.com>
> > > > Redirect 301 /alexboutiquehttp://www.alexboutique.com.mx/
> ...
>
> leer más »

Christina S

unread,
Jul 28, 2008, 8:11:45 PM7/28/08
to only-va...@googlegroups.com
OK, I will look for alternatives.

Christina

abracadabra

unread,
Nov 3, 2008, 8:52:42 AM11/3/08
to Only Validation + Navigation = Crawlability
The color scheme IMO is horrible!
It was better before.
red, blue and gaaa light green?

Did you ever hear of black, lt grey or blue and bolded black?

Yuk

webado

unread,
Nov 3, 2008, 9:07:04 AM11/3/08
to Only Validation + Navigation = Crawlability
What?

groover111

unread,
May 11, 2009, 4:20:29 PM5/11/09
to Only Validation + Navigation = Crawlability
Hi Christina , You have been helping me with some questions I had on
the webmaster tools forum....( I'm the guy from Montreal :) anyway,
you gave me a link for some code to help me with the 302- to 301
redirects issue I have with my word press blog...well I ended up
joining your group as you can see...

I have some question about the code above...Since I have a wordpress
site, I assume that I would be replacing index.html with index.php
that you have highlighted in green in the above code , am I
correct ?

However there are sections in the code already listed as index.php,
etc...I'm not clear about where I should be replacing with my
index.php

also would I be including the code that is in pink in my htaccess
file as well ?

here is my url www.home-alarms-systems.org if you need to look at
it.....


I'm sure you are pretty busy, but if you had some time I would really
appreciate your help ...

Thanks

Patrick

Christina S

unread,
May 12, 2009, 1:36:49 AM5/12/09
to only-va...@googlegroups.com
Hi Patrick,

Keep the part of the code about index.php being redirected to the root .
Keeping the redirections for all of them won't hurt unless you actually use
them for different things.
Also keep the code that redirects non-www to www or vice-versa.

The part in pink does not apply to your site, it's about adding a trailing
slash to a folser url if the server doesn't already do it automatically.

Basically this is what you need, added to the .htaccess file after whatever
you currently have in it right now.:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]


### re-direct www to non-www
RewriteCond %{http_host} !^home-alarms-systems.org$ [nc]
RewriteRule ^(.*)$ http://home-alarms-systems.org/$1 [r=301,nc,L]


Christina
www.webado.net

----- Original Message -----
From: "groover111" <realtime...@gmail.com>
To: "Only Validation + Navigation = Crawlability"
<only-va...@googlegroups.com>

Nancy

unread,
Oct 27, 2009, 11:18:59 AM10/27/09
to Only Validation + Navigation = Crawlability
Hi Christina,

I used the code as indicated above in the .htaccess file. All was
well for a period of time. Today my home page comes up as
http://www.byronstock.com/#at on a Firefox browser. This does not
happen on Safari or Internet Explorer. I called my web host and they
don't see it on their browser -- also not on another computer in our
office. I've cleared the private data in Firefox and this still
happens. Could this /#at trailing after the home page have something
to do with the code above?

Here's the code in my htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^byronstock.com
RewriteRule (.*) http://www.byronstock.com/$1 [R=301,L]

redirect 301 /5quotes.html http://www.byronstock.com/ei/eiarticles.html
MORE 301 REDIRECTS FOLLOWED BY CODE BELOW

Options +FollowSymlinks
RewriteEngine on
RewriteBase /


### re-direct index.html to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ /$1 [R=301,L]



### re-direct index.htm to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.htm\ HTTP/
RewriteRule ^(.*)index\.htm$ /$1 [R=301,L]



### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]



### re-direct default.html to root / ###
RewriteCond %{THE_REQUEST} ^.*\/default\.html\ HTTP/
RewriteRule ^(.*)default\.html$ /$1 [R=301,L]



### re-direct home.html to root / ###
RewriteCond %{THE_REQUEST} ^.*\/home\.html\ HTTP/
RewriteRule ^(.*)home\.html$ /$1 [R=301,L]



### re-direct home.htm to root / ###
RewriteCond %{THE_REQUEST} ^.*\/home\.htm\ HTTP/
RewriteRule ^(.*)home\.htm$ /$1 [R=301,L]


### re-direct IP address to www

### re-direct non-www to www

### re-direct any parked domain to www of main domain
RewriteCond %{http_host} !^www.byronstock.com$ [nc]
RewriteRule ^(.*)$ http://www.byronstock.com/$1 [r=301,nc,L]
####

Duty Gear Store

unread,
Oct 28, 2009, 6:48:37 PM10/28/09
to only-va...@googlegroups.com
For some reason I recieved this email. It does not pertain to me.

Christina S

unread,
Oct 28, 2009, 8:54:26 PM10/28/09
to only-va...@googlegroups.com
Hi,

You are subscribed to that particular thread or to the group in general.

That's why you received it.

You can change your options.

Christina
www.webado.net


----- Original Message -----
From: "Duty Gear Store" <dutyge...@gmail.com>
To: <only-va...@googlegroups.com>
Sent: Wednesday, October 28, 2009 6:48 PM
Subject: Only Validation Re: Discussion on
fix-canonical-issues-www-vs-non-www-and-more-on-apache-server


>

Duty Gear Store

unread,
Oct 29, 2009, 9:14:50 AM10/29/09
to only-va...@googlegroups.com
i am so sorry and thank you
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages