隐藏的php文件扩展名 [英] hidden php file extension
问题描述
那里有
我怎么能在这个URL中隐藏php文件扩展名这样的东西
( http://mail.google.com/mail/?view )
注意......
there
how can i make php file extension hidden in the URL somthing like this
(http://mail.google.com/mail/?view)
Regard....
推荐答案
Ba *********** @ gmail.com 写道:
Ba***********@gmail.com writes:
有
<我怎样才能在这个URL中隐藏php文件扩展名
( http://mail.google.com/mail/?view )
如果执行此操作,参数?视图会附加索引.php文件在
那个dir,所以这很简单,只要确保你的index.php
理解?查看。另一种方法是将.html(.htm)文件解析为php,然后你有index.html但你可以在文件中使用
php。
-
Henrik Hansen
If you do this the parameter ?view is appended the index.php file in
that dir, so it''s quite easy, just make sure your index.php
understands ?view. Another way is to make .html (.htm) files to be
parsed as php, then you have index.html but you can actually use
php in the file.
--
Henrik Hansen
Henrik建议是正确的。掩盖文件扩展名的另一种方法是使用apache中的mod_rewrite
Henrik suggestions are correct. Another way to mask file extensions is
by using mod_rewrite in apache
Henrik Hansen写道:
Henrik Hansen wrote:
Ba***********@gmail.com 写道:
Ba***********@gmail.com writes:
有
我怎样才能在这个URL中隐藏php文件扩展名
( http://mail.google.com/mail/?view )
如果你这样做,参数?view附加在
那个dir的index.php文件中,所以这很简单,只要确保你的index.php
理解?view。另一种方法是将.html(.htm)文件解析为php,然后你有index.html但你可以在文件中使用
php。
If you do this the parameter ?view is appended the index.php file in
that dir, so it''s quite easy, just make sure your index.php
understands ?view. Another way is to make .html (.htm) files to be
parsed as php, then you have index.html but you can actually use
php in the file.
这不是一个好主意,因为它会给服务器带来负担。现在
对于每个.html页面apache服务器,它必须解析每个.html
页面的php脚本,即使页面中没有php脚本。这个
确实会增加服务器的负载。这一切都转换为SLOWER
页面。这是你真正想要实现的目标吗?
That is not really a good idea as it puts a hugh load on the server. Now
for EVERY .html page apache servers it will have to parse each .html
page for php script, even if the page has no php script in it. This
really increases the load on the server. It all translates to SLOWER
pages. Is that what you really want to achieve?
这篇关于隐藏的php文件扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!