php伪静态 php伪静态怎么弄啊,有谁会具体一些,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 假说我我想把 news/index.php 改成news/index.html <IfModule mod_rewrite.c>RewriteEngine On RewriteRule ^index.html$ index.php </IfModule> 保存名为.htaccess的文件放根目录localhost/index.htm=ocalhost/index.php apache <Directory /> ... AllowOverride ALL...</Directory> fwrite($old,$new) 生成静态页面 应该是修改APACHE下HTTP。CONF里的rewrite模块,具体怎么改,应该谷歌上有相关介绍的! 这个是apache的URL重写nginx也基本上差不多 如果楼主只想实现.htm当php文件处理,不需要用rewrite重写!如果是apache服务器,找到:AddType application/x-httpd-php .php在这后面加一个 .htm就可以了,像这样:AddType application/x-httpd-php .php .htm如果是nginx服务器在nginx.conf里找到location ~ .*\.(php|php5)?$改成location ~ .*\.(php|php5|htm)?$index.htm服务器会当php解析的!如果你要保留服务器文件名为index.php,当路径又要是index.htm,那就得用重写了!apache的配置方法:http://hi.baidu.com/tianliao1988/blog/item/a4ae32cea1d01e35f8dc61d0.htmlnginx的配置示例:location ~ .*\.(htm)?${ root /var/www/html/news; rewrite /(.*\.php?) /$1 break; include fastcgi.conf; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php;} 我想把所有以.php结尾的换成.html怎么写啊 关于mysql_close() discuzX做的测试网站,散分 zen-cart的一个小问题 关于CORESEEK增量索引的问题! 刚学习php 请教一个简单问题 linux下用php创建文件夹的问题 向熟悉phpwind 论坛的朋友 求救一些问题 bosS要我在网站上添加一个英文页面啊,没做过 关于web前端传参数给后台的问题 ==========NetBeans IDE php 8.0 UTF8编码的问题======= phpexcel读取合并单元格的值 php用open falsh chart绘图问题
RewriteEngine On
RewriteRule ^index.html$ index.php
</IfModule>
保存名为.htaccess的文件放根目录localhost/index.htm=ocalhost/index.php
...
AllowOverride ALL
...
</Directory>
这个是apache的URL重写nginx也基本上差不多
AddType application/x-httpd-php .php
在这后面加一个 .htm就可以了,像这样:
AddType application/x-httpd-php .php .htm如果是nginx服务器
在nginx.conf里找到
location ~ .*\.(php|php5)?$
改成
location ~ .*\.(php|php5|htm)?$
index.htm服务器会当php解析的!如果你要保留服务器文件名为index.php,当路径又要是index.htm,那就得用重写了!
apache的配置方法:
http://hi.baidu.com/tianliao1988/blog/item/a4ae32cea1d01e35f8dc61d0.htmlnginx的配置示例:location ~ .*\.(htm)?$
{
root /var/www/html/news;
rewrite /(.*\.php?) /$1 break;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}