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 > Apache Rewrite Query
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

Apache Rewrite Query

Réponse
 
LinkBack Outils de la discussion
Vieux 01/07/2005, 15h45   #1
Chris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Apache Rewrite Query

Hi,

I've moved a site from one location to another, and am using modRewrite
to direct requests to the old address to the new one as follows:

RewriteEngine On
RewriteRule ^(.+) http://new.example.net/bounce/$1 [R,L]

When I visit the old site http://old.example.org/bounce/ things work fine.

If I visit it without the trailing slash
(http://old.example.org/bounce), it tries to redirect to
http://new.example.net/bounce//var/www/old/bounce - which doesn't exist.

Would anyone be able to suggest how I could correct this?

Many thanks.
  Réponse avec citation
Vieux 02/07/2005, 06h14   #2
Tim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Apache Rewrite Query

On Fri, 01 Jul 2005 14:45:39 +0100,
Chris <write@~tochris~.~c0m~> posted:

> I've moved a site from one location to another, and am using modRewrite
> to direct requests to the old address to the new one as follows:
>
> RewriteEngine On
> RewriteRule ^(.+) http://new.example.net/bounce/$1 [R,L]


You'd really want to also set proper HTTP error response codes, too. Such
as 301 (moved permanently) (use "R=301" instead of just "R"). I believe
the default redirection is a "temporary" redirection instruction (at least
my Apache manual says so).

That way, any compliant robots will update their information to the new
address (subsequent requests will be made directly to the new address, and
the old address will eventually be ignored). Otherwise, they're forever
accessing your old location, and should the old location become defunct
they won't be accessing the new one, at all.

See: <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>

> When I visit the old site http://old.example.org/bounce/ things work fine.
>
> If I visit it without the trailing slash
> (http://old.example.org/bounce), it tries to redirect to
> http://new.example.net/bounce//var/www/old/bounce - which doesn't exist.
>
> Would anyone be able to suggest how I could correct this?


Another specific rule for the omitted slash, perhaps? Though it sounds
odd. Doesn't the redirection have to be to a URI not file path?

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
  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 02h59.


É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,08621 seconds with 10 queries