PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.unix > htaccess q: preventing www at beginning of address
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

htaccess q: preventing www at beginning of address

Réponse
 
LinkBack Outils de la discussion
Vieux 25/02/2005, 18h08   #1 (permalink)
LJM
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut htaccess q: preventing www at beginning of address

My WPP has somehow configured the (Unix) webserver to prefix the URL
with a www. if there is no trailing slash (/) at the end of the URL.

eg. http://myurl.com/test/ is left untouched but
http://myurl.com/test is changed to
http://www.myurl.com/test/ ...which causes all further links to be
prefixed with www.

I want to stop this. Is there anything I could put in .htaccess to just
put a trailing slash on the end, but prevent the www being prefixed?
--
Lee J. Moore
"Life is short, art is long."
  Réponse avec citation
Vieux 26/02/2005, 02h01   #2 (permalink)
David Efflandt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: htaccess q: preventing www at beginning of address

On 25 Feb 2005 18:08:29 GMT, LJM <subtextwhore@gmail.com> wrote:
> My WPP has somehow configured the (Unix) webserver to prefix the URL
> with a www. if there is no trailing slash (/) at the end of the URL.
>
> eg. http://myurl.com/test/ is left untouched but
> http://myurl.com/test is changed to
> http://www.myurl.com/test/ ...which causes all further links to be
> prefixed with www.
>
> I want to stop this. Is there anything I could put in .htaccess to just
> put a trailing slash on the end, but prevent the www being prefixed?


Read apache docs for UseCanonicalName. But you may not be able to set
that off in .htaccess, because it says Context: server config, virtual
host, directory, but virtual host and directory can only be done in server
config. So your web host would need to change that (possibly within your
VirtualHost section if a virtual host).
  Réponse avec citation
Vieux 26/02/2005, 14h04   #3 (permalink)
LJM
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: htaccess q: preventing www at beginning of address

Friends, David Efflandt, countrymen, lend me your newsreaders:
> On 25 Feb 2005 18:08:29 GMT, LJM <subtextwhore@gmail.com> wrote:
>> My WPP has somehow configured the (Unix) webserver to prefix the URL
>> with a www. if there is no trailing slash (/) at the end of the URL.
>>
>> eg. http://myurl.com/test/ is left untouched but
>> http://myurl.com/test is changed to
>> http://www.myurl.com/test/ ...which causes all further links to be
>> prefixed with www.
>>
>> I want to stop this. Is there anything I could put in .htaccess to just
>> put a trailing slash on the end, but prevent the www being prefixed?

>
> Read apache docs for UseCanonicalName. But you may not be able to set
> that off in .htaccess, because it says Context: server config, virtual
> host, directory, but virtual host and directory can only be done in server
> config. So your web host would need to change that (possibly within your
> VirtualHost section if a virtual host).


It was actually leaving the URL alone unless a directory was specified
without a trailing slash. In adding the slash, it also added the www.
at the beginning of the URL. I figured the following RewriteRule would
fix it:

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

I don't think that will cause problems elsewhere.
--
Lee J. Moore
"Life is short, art is long."
  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 23h13.


Édité par : vBulletin® version 3.7.2
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
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08743 seconds with 11 queries