PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > Parked domain doesn't work correctly without opening www
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

Parked domain doesn't work correctly without opening www

Réponse
 
LinkBack Outils de la discussion
Vieux 14/01/2008, 21h11   #1
Jason Carlton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Parked domain doesn't work correctly without opening www

I had mentioned in an earlier thread that I'm using several domains
parked on top of another domain, and based on the domain that's typed
in the visitor might see different information.

Originally, I had a problem that if they left off the trailing /, they
were being redirected to the main domain and not seeing the
information specific to the domain that they typed in. I was able to
resolve this by adding this to the .htaccess:

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/

However, I recently discovered that if they leave off the opening www,
the same problem happens. So, I need a way to see if the www is
present, and if not then plug it in.

I read through the Apache manual and didn't see a reference to this,
so I'm hoping you guys can me out again. I know how to push
something to the end, but how do I get it at the beginning?

TIA,

Jason
  Réponse avec citation
Vieux 15/01/2008, 09h58   #2
phantom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Parked domain doesn't work correctly without opening www

"Jason Carlton" <jwcarlton@gmail.com> wrote in message
news:f678a10d-bb7a-4adf-8f38-f21bc0f76e67@e6g2000prf.googlegroups.com...
>I had mentioned in an earlier thread that I'm using several domains
> parked on top of another domain, and based on the domain that's typed
> in the visitor might see different information.
>
> Originally, I had a problem that if they left off the trailing /, they
> were being redirected to the main domain and not seeing the
> information specific to the domain that they typed in. I was able to
> resolve this by adding this to the .htaccess:
>
> RewriteCond %{REQUEST_FILENAME} -d
> RewriteRule ^(.+[^/])$ $1/
>
> However, I recently discovered that if they leave off the opening www,
> the same problem happens. So, I need a way to see if the www is
> present, and if not then plug it in.
>


something like this?

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


  Réponse avec citation
Vieux 16/01/2008, 09h14   #3
Jason Carlton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Parked domain doesn't work correctly without opening www

On Jan 15, 4:58am, "phantom" <nob...@blueyonder.invalid> wrote:
> "Jason Carlton" <jwcarl...@gmail.com> wrote in message
>
> news:f678a10d-bb7a-4adf-8f38-f21bc0f76e67@e6g2000prf.googlegroups.com...
>
>
>
>
>
> >I had mentioned in an earlier thread that I'm using several domains
> > parked on top of another domain, and based on the domain that's typed
> > in the visitor might see different information.

>
> > Originally, I had a problem that if they left off the trailing /, they
> > were being redirected to the main domain and not seeing the
> > information specific to the domain that they typed in. I was able to
> > resolve this by adding this to the .htaccess:

>
> > RewriteCond %{REQUEST_FILENAME} -d
> > RewriteRule ^(.+[^/])$ $1/

>
> > However, I recently discovered that if they leave off the opening www,
> > the same problem happens. So, I need a way to see if the www is
> > present, and if not then plug it in.

>
> something like this?
>
> RewriteCond %{HTTP_HOST} !^www\.
> RewriteRule (.*)http://www.%{HTTP_HOST}$1 [R=301,L]- Hide quoted text -


Thanks, Phantom! But when I plug that in, it takes me to
http://www.parkeddomain.compublic_html/, which of course just gives an
error that the domain doesn't exist.

If I remove the $1 in the RewriteRule, you can leave off the www when
going to the homepage (which is 1000 times better than before!), but
not an internal directory. So, http://parkeddomain.com works, but not
http://parkeddomain.com/directory/ (this will redirect to the main
domain instead of the parked one).

I was, however, able to make this work:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

I'm not sure if this is the BEST option, but it does work.

Thanks again, Phantom,

Jason
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h51.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10039 seconds with 11 queries