• 技术文章 >php教程 >php手册

    apache配置

    2016-08-31 08:40:56原创675
    
        ServerAdmin webmaster@dummy-host2.example.com
        ServerAdmin webmaster@dummy-host.example.com
        DocumentRoot "e:/www/WapSources/01 code"
        ServerName wap.weilan.com
        #ServerAlias www.dummy-host.example.com
        #ErrorLog "logs/dummy-host.example.com-error.log"
        #CustomLog "logs/dummy-host.example.com-access.log" common
        
        
            Options Indexes FollowSymLinks
            AllowOverride all
            Order allow,deny
            Allow from all
        
        
            RewriteEngine on
            RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
            RewriteRule .* - [F]
            Rewriterule ^(.*)/(.*)/index.html$ $1/index.php?$2
            Rewriterule ^(.*)/(.*)/index(\d+).html$ $1/index.php?$2&page=$3
            Rewriterule ^(.*)/(.*)/a(\d+)\.html$ $1/index.php?$2/$3
            Rewriterule ^(.*)/u/(\d+)/(.*)$ $1/index.php?u&$2&$3
            Rewriterule ^(.*)/u/(\d+)/(.*)/$ $1/index.php?u&$2&$3
            Rewriterule ^(.*)/u/(\d+)$ $1/index.php?u&$2
            Rewriterule ^(.*)/u/(\d+)/$ $1/index.php?u&$2
            Rewriterule ^(.*)/(.*)/index.html\?(.*) $1/index.php?$2&$3
            Rewriterule ^(.*)/(.*)/index(\d+).html\?(.*) $1/index.php?$2&$3
            Rewriterule ^(.*)/index.action(.*) $1/index.php$3
        
        
    

    简洁版:

    #指定自己的哪个网卡的哪个IP地址,可以访问虚拟主机
    NameVirtualHost *:80

    #指定虚拟主机的域名
    ServerName yangzailu.com
    #指定虚拟目录
    DocumentRoot "e:/www/web1"
    #指定目录权限

    Options Indexes FollowSymLinks
    AllowOverride All
    Order Deny,Allow
    Deny from all
    Allow from all

    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
    专题推荐:apache配置
    上一篇:ajax跳转传参 下一篇:自己动手写 PHP MVC 框架(40节精讲/巨细/新人进阶必看)

    相关文章推荐

    • 利用PHP实现智能文件类型检测的实现代码• 建立文件交换功能的脚本(二)• PHP教程.应用实例2 • 通过缓存数据库结果提高PHP性能• 对MVC的理解,MVC理解
    1/1

    PHP中文网