谢谢各位的解达,如果 http://localhost/file/m.php/86/273X http://localhost/file/m/86/273X.php 这多个参数的应该怎么去写呢?我写这个成功了,localhost/001.htm RewriteEngine on RewriteBase / RewriteRule (.+)\.htm$ show.php?id=$1 [L]但是这样就不行,localhost/001.php RewriteEngine on RewriteBase / RewriteRule (.+)\.php$ show.php?id=$1 [L]郁闷死了...
http://localhost/file/m.php/86/273X http://localhost/file/m/86/273X.phpRewriteEngine on RewriteBase / RewriteRule (.+)\.htm$ show.php?id=$1 [L] 这个应该怎么写呢?
似乎这样可以隐藏 httpd.conf ------------- # ... # Minimize 'Server' header information ServerTokens Prod # Disable server signature on server generated pages ServerSignature Off # ... # Set default file type to PHP DefaultType application/x-httpd-php # ...php.ini ------------ ; ... expose_php = Off ; ...然后看起来就像这样 http://my.server.com/forums/post?forumid=15
可以用.htaccess的rewrite来实现。
http://localhost/file/m.php/86/273X http://localhost/file/m/86/273X.php 我只想实践这个 RewriteEngine on RewriteBase / RewriteRule ???????????? 那么这个正则应该怎么写呢?
# 使 PHP 代码看上去像 ASP 页面 AddType application/x-httpd-php .asp
查看详细的Apache rewrite文档,用rewrite规则隐藏PHP扩展名
http://localhost/file/m.php/86/273X
http://localhost/file/m/86/273X.php
这多个参数的应该怎么去写呢?我写这个成功了,localhost/001.htm
RewriteEngine on
RewriteBase /
RewriteRule (.+)\.htm$ show.php?id=$1 [L]但是这样就不行,localhost/001.php
RewriteEngine on
RewriteBase /
RewriteRule (.+)\.php$ show.php?id=$1 [L]郁闷死了...
http://localhost/file/m/86/273X.phpRewriteEngine on
RewriteBase /
RewriteRule (.+)\.htm$ show.php?id=$1 [L]
这个应该怎么写呢?
httpd.conf
-------------
# ...
# Minimize 'Server' header information
ServerTokens Prod
# Disable server signature on server generated pages
ServerSignature Off
# ...
# Set default file type to PHP
DefaultType application/x-httpd-php
# ...php.ini
------------
; ...
expose_php = Off
; ...然后看起来就像这样
http://my.server.com/forums/post?forumid=15
http://localhost/file/m/86/273X.php
我只想实践这个
RewriteEngine on
RewriteBase /
RewriteRule ????????????
那么这个正则应该怎么写呢?
AddType application/x-httpd-php .asp
例子: http://vietnam.cvmachine.com/bcenter/register.simple
DefaultType application/x-httpd-php
expose_php = Off
或
AddType application/x-httpd-php .asp
都是种不错的方法。如果用rewrite 应该这样:#localhost/001.php
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^(.*/)?show\.php$ [NC]
RewriteRule (.+)\.php$ show.php?id=$1 [L]
不然会造成死循环
似乎这样可以隐藏
httpd.conf
-------------
# ...
# Minimize 'Server' header information
ServerTokens Prod
# Disable server signature on server generated pages
ServerSignature Off
# ...
# Set default file type to PHP
DefaultType application/x-httpd-php
# ...php.ini
------------
; ...
expose_php = Off
; ...然后看起来就像这样
http://my.server.com/forums/post?forumid=15
-------------------------------------
依照这个方法,我的没有实现,还有别的需要修改吗?
提示文件未找到,该怎么测试?