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 > Re: Parse all into one page using php into Apache
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

Re: Parse all into one page using php into Apache

Réponse
 
LinkBack Outils de la discussion
Vieux 21/09/2006, 04h33   #1
BlackSpider
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Parse all into one page using php into Apache

Why not just use one php page, index.php, and use SSI, so all pages would
be...

http://www.blahblah.com/index.php?page=whatever

Like:

<?php
if (isset($_GET['page'])) {
$request = $_GET['page'];

if ($request == "main") { include("main.php"); }
else if ($request == "faq") { include("faq.php"); }
else { include("main.php"); }

} else { include("main.php"); }

?>


With that, you can staticly define what pages exist. Followed by the first
'else', if the page doesn't exist it loads up 'main.php' in to the page. Or
if the ?page=whatever is missing, it loads up main.php.


<cancuen@gmail.com> wrote in message
news:1158781106.188397.65430@i3g2000cwc.googlegrou ps.com...
> First: hello. I'm new in this group, and I'm a php programmer and not
> know much about conf or ht files in Apache, for what i read in the
> manual.
> Second. I have joined this group, because have an issue to know.
>
> I'm a php programmer and for some sites, it's needed to all the pages
> requested, goes actually to be parsed into one sole page. This for
> security reasons mostly. The question I have is: how redirect any page
> (extesion especific, name specific, etc) to be parsed in one specified
> without making any changes into users navigation bar, or send an error
> (eg. 404) for not finding the page, or so. The quierystrings and/or the
> directories, etc., I can handle with php.
>
> The thing is that might be possible with mod_rewrite, but, to work
> correctly, and not slow or with some issues that the manual says. How
> ever that souldn't be so difficult 'cause are regexp, buet not all
> Server Admins will let me, 'touch' their conf files.
>
> I't have to be a .htaccess or similar way to do that.
>
> Thanks for your attention, and in advance for any or ideas
> provided.
>
> Mario Soto
> mariosoto@cancuen.net
> ..._
>



  Réponse avec citation
Vieux 02/10/2006, 17h44   #2
Yamaska
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Parse all into one page using php into Apache

cancuen@gmail.com wrote:
> The thing is:
> http://www.example.com/rock/metallica
>>> to be parsed as directory when no exists>>

> http://www.example.com/index.php?gen...roup=metallica
>
> How ever all the string that follows the .com in this example I can
> make what ever I wanted with regexp, not only turn into some variables.
> What I want is to any page would be parsed with one specified page
> (except images by example, or zip files, or...).
>
> BlackSpider wrote:
>> Why not just use one php page, index.php, and use SSI, so all pages would
>> be...
>>
>> http://www.blahblah.com/index.php?page=whatever
>>
>> Like:
>>
>> <?php
>> if (isset($_GET['page'])) {
>> $request = $_GET['page'];
>>
>> if ($request == "main") { include("main.php"); }
>> else if ($request == "faq") { include("faq.php"); }
>> else { include("main.php"); }
>>
>> } else { include("main.php"); }
>>
>> ?>
>>

>


How about using the POST instead of the GET variables,.. and read a menu
from xml or soomthing like that,..

anyways it's a php issue,.. apache will NOT do POSTS etc for you in this
way to have only "seemingly" one page

apache does not handle menu structures for you.



Pete
  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 01h24.


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