在网址中包含页面 [英] inclusion page in url

查看:91
本文介绍了在网址中包含页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我有一个小疑问,我在导航网站时来了

网页,实际上可以看到其他页面

总是在网址中有一个给定的页面,我会用一个更清晰的

例子来解释, www.site.it/homepage.php

显示网站的首页,但如果我做了 www.site.it/homepage.php#/utenti.php

查看用户列表,我想知道我怎么可以在php中做这样的事情?我提出了这个问题? :D


谢谢

解决方案

co ******* @ gmail.com 写道:


你好,我对我有一点怀疑在导航网站时来了

web,几乎可以看到其他页面

在网址中总是有一个给定的页面,我会用
$来解释b $ b更清晰的例子, www.site.it/homepage.php

显示网站的首页,但如果我做了 www.site.it/homepage.php#/utenti.php

查看用户列表,我想知道我怎么能

在php中做这样的事情?我提出了这个问题? :D


谢谢



你不需要PHP - 这是直接的HTML和可能的apache

配置(mod_rewrite)。


-

=============== ===

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


2008年9月16日星期二17:23:59 -0700, co * ******@gmail.com 写道:


你好,我有一个小疑问,我是在浏览网站时出现的,

几乎可以看到其他页面,而且总是有一个给定的页面

在url中,我会解释一个更清晰的例子,
www.site.it/homepage.php 显示网站的首页,但如果我

确实 www.site.it/ homepage.php#/ utenti.php 查看用户列表,我是否想知道如何在php中做这样的事情?
我提出了这个问题? :

D


谢谢



假设您有页面 http://nl.php.net/manual/en/index.php 。请求
http:/ /nl.php.net/manual/en/index.php/any.file.name 也将由index.php提供给
。在此示例中,它不会更改页面,但PHP

文件可能会解析URL并决定在URL为
不同时提供其他内容。


有谁知道这个功能叫什么或为什么会这样?


Sjoerd写道:


2008年9月16日星期二17:23:59 -0700, co ******* @ gmail.com 写道:


>你好,我有一个小疑问,我是在浏览网站时来的,
几乎可以看到其他页面,而在网址中总是有一个给定的页面,我会用一个更清晰的例子来解释,
www.site.it/homepage.php 显示网站的首页,但如果我确实 www.site.it/homepage.php#/ute nti.php 查看用户列表,我想知道如何在php中做这样的事情?我提出了这个问题? :
感谢



假设您有页面 http://nl.php.net/manual/en/index.php 。请求
http:/ /nl.php.net/manual/en/index.php/any.file.name 也将由index.php提供给
。在此示例中,它不会更改页面,但PHP

文件可能会解析URL并决定在URL为
不同时提供其他内容。


任何人都知道这个功能叫什么或为什么这样工作?



是的,正如Jerry在上面说''apache'的mod_rewrite模块。


这是一个系统使用正则表达式进行模式匹配并将您在GET请求中收到的URL转换为您实际需要的URL。


您在中指定重写指令htaccess文件中的apache配置文件或(对于

个别用户)。

通过重写URL,您可以将路径更改为变量,例如


您将收到 http://www.poo.poo/images/獾


和mod_rewrite可以将其改为:

http://www.poo.poo/imagescript.php?type = badgers


因此将路径映射到PHP脚本和变量。


考虑到s,参考文档非常可怕实现

大多数人都有使用案例所以我不确定我是否推荐阅读和

正则表达式(正则表达式)可能需要很长时间才能解决问题

所以要准备好花几天晚上掌握它!一些有用的

示例可以在这里找到:
http://httpd.apache.org/docs/1.3/misc/rewriteguide.html

Roger Heathcote。


hello, I have a small doubt that I came while navigating a site
web, practically could see the other pages while
Having always a given page in url, I''ll explain with a
example that is much clearer, www.site.it/homepage.php
displaying the front page of the site, but if I did www.site.it/homepage.php#/utenti.php
view list of users, I was wondering how I could
do such a thing in php? I raised this question? : D

thanks

解决方案

co*******@gmail.com wrote:

hello, I have a small doubt that I came while navigating a site
web, practically could see the other pages while
Having always a given page in url, I''ll explain with a
example that is much clearer, www.site.it/homepage.php
displaying the front page of the site, but if I did www.site.it/homepage.php#/utenti.php
view list of users, I was wondering how I could
do such a thing in php? I raised this question? : D

thanks

You don''t need PHP for this - it''s straight html and possibly apache
configuration (mod_rewrite).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


On Tue, 16 Sep 2008 17:23:59 -0700, co*******@gmail.com wrote:

hello, I have a small doubt that I came while navigating a site web,
practically could see the other pages while Having always a given page
in url, I''ll explain with a example that is much clearer,
www.site.it/homepage.php displaying the front page of the site, but if I
did www.site.it/homepage.php#/utenti.php view list of users, I was
wondering how I could do such a thing in php? I raised this question? :
D

thanks

Say you have the page http://nl.php.net/manual/en/index.php. A request to
http://nl.php.net/manual/en/index.php/any.file.name will also be served
by index.php. In this example, it does not change the page, but the PHP
file may parse the URL and decide to serve something else when the URL is
different.

Anybody knows what this feature is called or why this works like this?


Sjoerd wrote:

On Tue, 16 Sep 2008 17:23:59 -0700, co*******@gmail.com wrote:

>hello, I have a small doubt that I came while navigating a site web,
practically could see the other pages while Having always a given page
in url, I''ll explain with a example that is much clearer,
www.site.it/homepage.php displaying the front page of the site, but if I
did www.site.it/homepage.php#/utenti.php view list of users, I was
wondering how I could do such a thing in php? I raised this question? :
D

thanks


Say you have the page http://nl.php.net/manual/en/index.php. A request to
http://nl.php.net/manual/en/index.php/any.file.name will also be served
by index.php. In this example, it does not change the page, but the PHP
file may parse the URL and decide to serve something else when the URL is
different.

Anybody knows what this feature is called or why this works like this?

Yes, as Jerry says above that''s apache''s mod_rewrite module.

It''s a system that uses regular expressions to pattern match and convert
the URLs you receive in a GET requests into the URLs you actually want.

You specify rewrite directives in you apache config file OR (for
individual users) in htaccess files.

By rewriting the URLS you can change paths into variables e.g.

You receive http://www.poo.poo/images/badgers

and mod_rewrite could change that into:

http://www.poo.poo/imagescript.php?type=badgers

Thereby mapping paths to PHP scripts and variables.

The reference documentation is quite terrifying considering the simple
use cases most people have so I''m not sure I recommend reading and
regular expressions(regex) can take quite a while to get the hang of too
so be prepared to spend a few evenings mastering it! Some useful
examples can be found here:
http://httpd.apache.org/docs/1.3/misc/rewriteguide.html

Roger Heathcote.


这篇关于在网址中包含页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆