环境ubuntu14
apache2
php5
apt-get install php5
apt-get install libapache2-mod-php5
配置rewrite
ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
vim /etc/apache2/apache2.conf
最后一行
ServerName ubuntu
中间
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks
Require all denied
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Order allow,deny
Allow from all
</Directory>
主要是
AllowOverride All
Order allow,deny
Allow from all
/etc/apache2/sites-enabled/000-default.conf
设置根路径
DocumentRoot /var/www
在
/var/www下
建立
.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteRule "index.html" "index.php" [P,L]
RewriteRule "index.html" "index.php"
</IfModule>
apachectl restart
http://ubuntu/index.html
会跳转到index.php
分享到:
相关推荐
Rewrite是一种服务器的重写脉冲技术,它可以使得服务器可以支持 URL 重写,是一种最新流行的服务器技术。它还可以实现限制特定IP访问网站的功能。很多情况下,某个 IP 的访问很容易造成 CPU 100% (比如 某些搜索...
php Rewrite 拟静态
在网站根目录下加入: Web.Config: <?xml version=1.0 encoding=”UTF-8″?> <rewrite> ...^(index\.php|images|assets|robots\.txt)> <action type=Rewrite url=cnurl.php> </rul
alifast csend.php kindupload.php rewrite upload.php alipay.html db.sql manage rewrite.php vote api feedback manage.php robots.txt v.php app.php feed.php message r.php wap biz file...
在iis下为php添加rewrite功能 URL-Rewrite是一种URL地址静态化技术,可有效增加搜索引擎的收录。 下面分别介绍记事狗系统在IIS 服务器下的Rewrite设置方法(Apache服务器默认即可支持): 一、路径模式; 1、...
apache_rewrite语法的详细解析,实现php的URL重写。
PHP - Rewrite - 伪静态 Rewrite.dll
php-rewrite网站伪静态测试文件,测试你的空间是否支持伪静态。
rewrite.php
在空间商买的空间 不能自己配置 支持模式 若果可以配置可以用这个设置thinkphp3.2.3 支持rewrite 虽然简单但是网上的资源太少了这里整理一份
信赖此刻大部门用Linux VPS的伴侣都在利用这个敏捷传布的Nginx,本日就清算一下最常见的PHP法式的Rewrite(伪静态法则)。 Wordpress: location / { index index.html index.php; if (-f $request_filename/index....
lnmp环境中nginx的rwrite规则配置
伪静态是一种可以把文件后缀改成任何可能的一种方法,如果我想把php文件伪静态成html文件,这种相当简单的,下面我来介绍nginx 伪静态配置方法有需要了解的朋友可参考。
rewrite文件,iis静态文件配置,php网站静态化文件
在你的程序初始化时使用如下代码: 复制代码 代码如下:<?php $Php2Html_FileUrl = $_SERVER[“REQUEST_URI”];... foreach($Php2Html_UrlQueryStrList as $Php2Html_UrlQueryStr) { $Php2Html_TmpArray =
PHP100视频教程54:Apache Rewrite 拟静态配置 PHP100视频教程55:PHP5中使用PDO连接数据库 PHP100视频教程56:制作PHP安装程序的原理和步骤 PHP100视频教程57:PHP备份数据库原理和方法 PHP100视频教程58:快速...
2.修改配置文件(某些php框架需要) $ vim /etc/apache2/sites-available/000-default.conf 修改document dir 为所需要的路径 $vim vim /etc/apache2/apache2.conf 修改directly 为所需的路径 3.windows需要关闭...
php中处理模拟rewrite 效果<?php $Php2Html_FileUrl = $_SERVER[“REQUEST_URI”]; $Php2Html_UrlString = str_replace(“/”, “”, strrchr($Php2Html_FileUrl, “/”)); ?> <?php $sid=intval...
rewrite ^/index.html$ /index.php; rewrite ^/about.html$ /about.php; rewrite ^/top.html$ /top.php; rewrite ^/search.html$ /search.php; rewrite ^/apply.html$ /apply.php; rewrite ^/404.html$ /404.php; ...