zoukankan      html  css  js  c++  java
  • apache 伪静态配置

    1  现配置站点,

    <VirtualHost *:80>

    //访问名称

    ServerName my.seo_demo.com

    //项目地址

    DocumentRoot "/Users/lijundong/Documents/SeoDemo"

    //默认访问文件类型

    DirectoryIndex index.html index.php

    //错误日志存放地址

    ErrorLog "/Users/lijundong/Documents/SeoDemo/logs"

     // 以上为网站主要配置,下面是配置访问权限和网站其他伪静态等配置

    <Directory "/Users/lijundong/Documents/SeoDemo">

    //配置开不开启,目录列表

    Options -Indexes +FollowSymlinks

    //配置启用Rewrite 

    AllowOverride All

    Require all granted

    //设置都可以访问 ,Deny from all 都不可访问,还有order Allow Deny 设置访问 去中间差值

    Allow from all

    </Directory>

     </VirtualHost>

    directory 中没有配置的项 apache都会以父级中的配置为主

    2  cd /etc/hosts 中配置 127.0.0.1  xxx.xxx.cxx

    3  开启apache Rewrite模块

    LoadModule rewrite_module libexec/apache2/mod_rewrite.so  只要取消前面注视即可

    4  然后配置.htaccess文件

        文件内容为: 

          <IfModule rewrite_module> //是否存在该配置 相当于if else语句

          RewriteEngine On //开启rewrite

          RewriteRule  (d+).html$ index.php  //规则  此规则表示 然后以数字.html 都会访问index.php

          <IfModule>

    5  语句中的配置也可以写在httpd.cong 的该站点配置的directory 中;

    知识点来自:http://www.iqiyi.com/w_19rqqdt2ol.html#curid=1751966709_231918daaf7a28d60b4427cccb8c42de

  • 相关阅读:
    linux创建用户与删除用户及问题解决(ubuntu)
    Build tool
    Version Control&Git
    IntelliJ IDEA激活
    KDJ 指标
    MACD 分析理解
    MACD 指标
    BOLL 指标
    IaaS,PaaS,SaaS 的区别
    Kubernetes 第十七章 调度器 污点和容忍 以及高级调度方式
  • 原文地址:https://www.cnblogs.com/jackylee92/p/5762509.html
Copyright © 2011-2022 走看看