Re: [PHP] Mediawiki's url confusion

2009-07-23 Thread Dengxule
I think PATHINFO is probably what i'm looking for.

Paul mentioned the "lookback" feature, i think that is or about the same
thing.

MediaWiki-1.15.1 use the pattern of url for common pages like this :
some_path_to_mediawiki/index.php/something , and the 'something' supports
even non-english characters. Maybe this kind of usage to transfer params can
improve the SEO ?

I was trapped in the question "how can the MediaWiki scripts affect the
apache's behaviour", then finally found out it just takes advantage of the
existing "FEATURE" when i tried this kind of url to my script which var_dump
the $_SERVER and saw the "pathinfo" ...

Thank you all, best wishes ~

Deng

2009/7/23 Ford, Mike 

> > -Original Message-
> > From: Paul M Foster [mailto:pa...@quillandmouse.com]
> > Sent: 23 July 2009 06:13
> >
> > On Thu, Jul 23, 2009 at 11:57:51AM +0800, ?? wrote:
> >
> > > But I cannot help myself with the url pattern :
> > > /somepath_to_mediawiki/index.php/pagetitle.
> > >
> > > How can this kind of url be parsed to the file "index.php" and the
> > > "pagetitle" be parsed as params?
> > >
> > > Why the web server not go straight into path "index.php/" and look
> > for the
> > > file named "pagetitle" ?
> > >
> >
> > This type of thing is common for sites using the "MVC" or
> > "Model-View-Controller" paradigm. The index.php file is what's
> > called a
> > "front controller". A front controller is usually the entrance to
> > all
> > the other pages of a site. URLs like this often take advantage of an
> > Apache feature called "mod_rewrite", which tells Apache how to
> > handle
> > URLs which look like this.
>
> Or by the "pathinfo" mechanism, which I believe is also supported by other
> Web servers, and can work just as well, if it satisfies your requirements,
> without all the complications of mod_rewrite.
>
>
> Cheers!
>
> Mike
>  --
> Mike Ford,
> Electronic Information Developer,Libraries and Learning Innovation,
> Leeds Metropolitan University, C507, Civic Quarter Campus,
> Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
> Email: m.f...@leedsmet.ac.uk
> Tel: +44 113 812 4730
>
>
>
>
>
>
> To view the terms under which this email is distributed, please go to
> http://disclaimer.leedsmet.ac.uk/email.htm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Mediawiki's url confusion

2009-07-23 Thread Paul M Foster
On Fri, Jul 24, 2009 at 10:28:52AM +0800, Dengxule wrote:

> Thanks a lot. As far as i know, both methods dealing with urls are
> WEB-SERVER-TECH. While I was installing mediawiki, i did nothing with the
> file "httpd.conf", no changes made on .
> 
> The mediawiki install script cannot do nothing to httpd.conf i think.
> 
> So i'm confused about how the url-rewriting mechanism is activited.

This can also be accomplished by Apache's "lookback" feature. If it's
turned on on the server, Apache will look back through the URL until it
finds something which is a file, and then consider the remainder of the
URL parameters, which it provides to the file. Thus,

http://example.com/index.php/pepperoni/pizza

will end up at http://example.com/index.php with pepperoni/pizza as
parameter, assuming that pepperoni and pizza are not files/directories
and index.php is not a directory.

The lookback feature can be turned on in the Apache configuration file,
which, on a public server, you have no access to.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mediawiki's url confusion

2009-07-23 Thread sean greenslade
On Thu, Jul 23, 2009 at 10:28 PM, Dengxule  wrote:

> Thanks a lot. As far as i know, both methods dealing with urls are
> WEB-SERVER-TECH. While I was installing mediawiki, i did nothing with the
> file "httpd.conf", no changes made on .
>
> The mediawiki install script cannot do nothing to httpd.conf i think.
>
> So i'm confused about how the url-rewriting mechanism is activited.
>
> Best Wishes~
>
> Deng
> 09/07/24
>
>
> 2009/7/23 Ford, Mike 
>
> > > -Original Message-
> > > From: Paul M Foster [mailto:pa...@quillandmouse.com]
> > > Sent: 23 July 2009 06:13
> > >
> > > On Thu, Jul 23, 2009 at 11:57:51AM +0800, ?? wrote:
> > >
> > > > But I cannot help myself with the url pattern :
> > > > /somepath_to_mediawiki/index.php/pagetitle.
> > > >
> > > > How can this kind of url be parsed to the file "index.php" and the
> > > > "pagetitle" be parsed as params?
> > > >
> > > > Why the web server not go straight into path "index.php/" and look
> > > for the
> > > > file named "pagetitle" ?
> > > >
> > >
> > > This type of thing is common for sites using the "MVC" or
> > > "Model-View-Controller" paradigm. The index.php file is what's
> > > called a
> > > "front controller". A front controller is usually the entrance to
> > > all
> > > the other pages of a site. URLs like this often take advantage of an
> > > Apache feature called "mod_rewrite", which tells Apache how to
> > > handle
> > > URLs which look like this.
> >
> > Or by the "pathinfo" mechanism, which I believe is also supported by
> other
> > Web servers, and can work just as well, if it satisfies your
> requirements,
> > without all the complications of mod_rewrite.
> >
> >
> > Cheers!
> >
> > Mike
> >  --
> > Mike Ford,
> > Electronic Information Developer,Libraries and Learning Innovation,
> > Leeds Metropolitan University, C507, Civic Quarter Campus,
> > Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
> > Email: m.f...@leedsmet.ac.uk
> > Tel: +44 113 812 4730
> >
> >
> >
> >
> >
> >
> > To view the terms under which this email is distributed, please go to
> > http://disclaimer.leedsmet.ac.uk/email.htm
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

It could use a .htaccess file. Look in the directory of the index.php file
for a file named .htaccess

-- 
--Zootboy


Re: [PHP] Mediawiki's url confusion

2009-07-23 Thread Dengxule
Thanks a lot. As far as i know, both methods dealing with urls are
WEB-SERVER-TECH. While I was installing mediawiki, i did nothing with the
file "httpd.conf", no changes made on .

The mediawiki install script cannot do nothing to httpd.conf i think.

So i'm confused about how the url-rewriting mechanism is activited.

Best Wishes~

Deng
09/07/24


2009/7/23 Ford, Mike 

> > -Original Message-
> > From: Paul M Foster [mailto:pa...@quillandmouse.com]
> > Sent: 23 July 2009 06:13
> >
> > On Thu, Jul 23, 2009 at 11:57:51AM +0800, ?? wrote:
> >
> > > But I cannot help myself with the url pattern :
> > > /somepath_to_mediawiki/index.php/pagetitle.
> > >
> > > How can this kind of url be parsed to the file "index.php" and the
> > > "pagetitle" be parsed as params?
> > >
> > > Why the web server not go straight into path "index.php/" and look
> > for the
> > > file named "pagetitle" ?
> > >
> >
> > This type of thing is common for sites using the "MVC" or
> > "Model-View-Controller" paradigm. The index.php file is what's
> > called a
> > "front controller". A front controller is usually the entrance to
> > all
> > the other pages of a site. URLs like this often take advantage of an
> > Apache feature called "mod_rewrite", which tells Apache how to
> > handle
> > URLs which look like this.
>
> Or by the "pathinfo" mechanism, which I believe is also supported by other
> Web servers, and can work just as well, if it satisfies your requirements,
> without all the complications of mod_rewrite.
>
>
> Cheers!
>
> Mike
>  --
> Mike Ford,
> Electronic Information Developer,Libraries and Learning Innovation,
> Leeds Metropolitan University, C507, Civic Quarter Campus,
> Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
> Email: m.f...@leedsmet.ac.uk
> Tel: +44 113 812 4730
>
>
>
>
>
>
> To view the terms under which this email is distributed, please go to
> http://disclaimer.leedsmet.ac.uk/email.htm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


RE: [PHP] Mediawiki's url confusion

2009-07-23 Thread Ford, Mike
> -Original Message-
> From: Paul M Foster [mailto:pa...@quillandmouse.com]
> Sent: 23 July 2009 06:13
> 
> On Thu, Jul 23, 2009 at 11:57:51AM +0800, ?? wrote:
> 
> > But I cannot help myself with the url pattern :
> > /somepath_to_mediawiki/index.php/pagetitle.
> >
> > How can this kind of url be parsed to the file "index.php" and the
> > "pagetitle" be parsed as params?
> >
> > Why the web server not go straight into path "index.php/" and look
> for the
> > file named "pagetitle" ?
> >
> 
> This type of thing is common for sites using the "MVC" or
> "Model-View-Controller" paradigm. The index.php file is what's
> called a
> "front controller". A front controller is usually the entrance to
> all
> the other pages of a site. URLs like this often take advantage of an
> Apache feature called "mod_rewrite", which tells Apache how to
> handle
> URLs which look like this.

Or by the "pathinfo" mechanism, which I believe is also supported by other Web 
servers, and can work just as well, if it satisfies your requirements, without 
all the complications of mod_rewrite.


Cheers!

Mike
 -- 
Mike Ford,
Electronic Information Developer,Libraries and Learning Innovation,  
Leeds Metropolitan University, C507, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom 
Email: m.f...@leedsmet.ac.uk 
Tel: +44 113 812 4730






To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mediawiki's url confusion

2009-07-22 Thread Paul M Foster
On Thu, Jul 23, 2009 at 11:57:51AM +0800, ?? wrote:

> Hi everyone:
> 
> I've been studying the codes of Mediawiki for some time.
> 
> I'm convinced that the file "index.php" is the only entrance to the whole
> site.
> 
> But I cannot help myself with the url pattern :
> /somepath_to_mediawiki/index.php/pagetitle.
> 
> How can this kind of url be parsed to the file "index.php" and the
> "pagetitle" be parsed as params?
> 
> Why the web server not go straight into path "index.php/" and look for the
> file named "pagetitle" ?
> 

This type of thing is common for sites using the "MVC" or
"Model-View-Controller" paradigm. The index.php file is what's called a
"front controller". A front controller is usually the entrance to all
the other pages of a site. URLs like this often take advantage of an
Apache feature called "mod_rewrite", which tells Apache how to handle
URLs which look like this. You can look on wikipedia.org for these terms
or google for them, and find full explanations.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Mediawiki's url confusion

2009-07-22 Thread 邓序乐
Hi everyone:

I've been studying the codes of Mediawiki for some time.

I'm convinced that the file "index.php" is the only entrance to the whole
site.

But I cannot help myself with the url pattern :
/somepath_to_mediawiki/index.php/pagetitle.

How can this kind of url be parsed to the file "index.php" and the
"pagetitle" be parsed as params?

Why the web server not go straight into path "index.php/" and look for the
file named "pagetitle" ?



My first post ^_^ .And,I'm not sure if this issue should be talked here^_^.
  thank you however~

Lamp Deng
09/07/23