`
haoningabc
  • 浏览: 1449522 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

php rewrite

阅读更多
环境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
分享到:
评论

相关推荐

    php rewrite

    Rewrite是一种服务器的重写脉冲技术,它可以使得服务器可以支持 URL 重写,是一种最新流行的服务器技术。它还可以实现限制特定IP访问网站的功能。很多情况下,某个 IP 的访问很容易造成 CPU 100% (比如 某些搜索...

    php Rewrite 拟静态

    php Rewrite 拟静态

    IIS环境下PHP rewrite重写设置(支持中文参数)

    在网站根目录下加入: Web.Config: &lt;?xml version=1.0 encoding=”UTF-8″?&gt; &lt;rewrite&gt; ...^(index\.php|images|assets|robots\.txt)&gt; &lt;action type=Rewrite url=cnurl.php&gt; &lt;/rul

    最土团购系统 v2.0 build 20120502, WAP完整自己测试过

    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_rewrite.zip

    在iis下为php添加rewrite功能 URL-Rewrite是一种URL地址静态化技术,可有效增加搜索引擎的收录。 下面分别介绍记事狗系统在IIS 服务器下的Rewrite设置方法(Apache服务器默认即可支持): 一、路径模式; 1、...

    apache_rewrite语法

    apache_rewrite语法的详细解析,实现php的URL重写。

    Rewrite.dll - 伪静态

    PHP - Rewrite - 伪静态 Rewrite.dll

    php-rewrite网站伪静态测试文件

    php-rewrite网站伪静态测试文件,测试你的空间是否支持伪静态。

    rewrite.php

    rewrite.php

    空间支持rewrite 模式

    在空间商买的空间 不能自己配置 支持模式 若果可以配置可以用这个设置thinkphp3.2.3 支持rewrite 虽然简单但是网上的资源太少了这里整理一份

    Nginx常用Rewrite伪静态法则

    信赖此刻大部门用Linux VPS的伴侣都在利用这个敏捷传布的Nginx,本日就清算一下最常见的PHP法式的Rewrite(伪静态法则)。 Wordpress: location / { index index.html index.php; if (-f $request_filename/index....

    nginx设置rewrite规则

    lnmp环境中nginx的rwrite规则配置

    Nginx伪静态配置和常用Rewrite伪静态规则集锦

    伪静态是一种可以把文件后缀改成任何可能的一种方法,如果我想把php文件伪静态成html文件,这种相当简单的,下面我来介绍nginx 伪静态配置方法有需要了解的朋友可参考。

    rewrite文件,iis静态文件配置,php网站静态化文件

    rewrite文件,iis静态文件配置,php网站静态化文件

    不用mod_rewrite直接用php实现伪静态化页面代码

    在你的程序初始化时使用如下代码: 复制代码 代码如下:&lt;?php $Php2Html_FileUrl = $_SERVER[“REQUEST_URI”];... foreach($Php2Html_UrlQueryStrList as $Php2Html_UrlQueryStr) { $Php2Html_TmpArray =

    PHP100视频教程全集112集BT种子【PHP经典】

    PHP100视频教程54:Apache Rewrite 拟静态配置 PHP100视频教程55:PHP5中使用PDO连接数据库 PHP100视频教程56:制作PHP安装程序的原理和步骤 PHP100视频教程57:PHP备份数据库原理和方法 PHP100视频教程58:快速...

    apache 开启重定向 rewrite的实现方法

    2.修改配置文件(某些php框架需要) $ vim /etc/apache2/sites-available/000-default.conf 修改document dir 为所需要的路径 $vim vim /etc/apache2/apache2.conf 修改directly 为所需的路径 3.windows需要关闭...

    php中处理模拟rewrite 效果

    php中处理模拟rewrite 效果&lt;?php $Php2Html_FileUrl = $_SERVER[“REQUEST_URI”]; $Php2Html_UrlString = str_replace(“/”, “”, strrchr($Php2Html_FileUrl, “/”)); ?&gt; &lt;?php $sid=intval...

    php站长导航源码.rar

    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; ...

Global site tag (gtag.js) - Google Analytics