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 > Redirect
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

Redirect

Réponse
 
LinkBack Outils de la discussion
Vieux 07/10/2006, 17h07   #1
markus w
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Redirect

If a user requests mydomain.com/Someword/Someotherword and the path does not
exist, I want apache to redirect to a .php-script which looks up the words
in a database etc.

I'm able to do this using "ErrorDocument 404 error404.php", but there must
be a better way :-)

What is best way to do this?

markus

-----------------------------
Markus Walther
Oslo, Norway


  Réponse avec citation
Vieux 07/10/2006, 17h23   #2
markus w
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Redirect

Another option would be redirecting ALL requests to myfile.php. Is that
possible?

markus

-----------------------------
Markus Walther (1064954)
Oslo, Norway
"markus w" <markus@removethis.erfaring.com> wrote in message
news:4527d13c$1@news.broadpark.no...
> If a user requests mydomain.com/Someword/Someotherword and the path does
> not exist, I want apache to redirect to a .php-script which looks up the
> words in a database etc.
>
> I'm able to do this using "ErrorDocument 404 error404.php", but there must
> be a better way :-)
>
> What is best way to do this?
>
> markus
>
> -----------------------------
> Markus Walther
> Oslo, Norway
>



  Réponse avec citation
Vieux 07/10/2006, 17h40   #3
markus w
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Redirect

Got it! :-)

# Skip rewriting for

# ... special directories (/img & /js)

# RewriteRule ^/(img|js) - [L]

# ... special extensions (.css & .jpg)

RewriteRule \.(css|jpg|gif)$ - [L]

# Redirect everything (else) to index.php

RewriteRule ^(.*)$ /index.php


markus


-----------------------------
Markus Walther (1064954)
Oslo, Norway
"markus w" <markus@removethis.erfaring.com> wrote in message
news:4527d4e3@news.broadpark.no...
> Another option would be redirecting ALL requests to myfile.php. Is that
> possible?
>
> markus
>
> -----------------------------
> Markus Walther (1064954)
> Oslo, Norway
> "markus w" <markus@removethis.erfaring.com> wrote in message
> news:4527d13c$1@news.broadpark.no...
>> If a user requests mydomain.com/Someword/Someotherword and the path does
>> not exist, I want apache to redirect to a .php-script which looks up the
>> words in a database etc.
>>
>> I'm able to do this using "ErrorDocument 404 error404.php", but there
>> must be a better way :-)
>>
>> What is best way to do this?
>>
>> markus
>>
>> -----------------------------
>> Markus Walther
>> Oslo, Norway
>>

>
>



  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 18h50.


É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,11416 seconds with 11 queries